Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all ,
I am developing my first asp.net 4.0 web application to find a html tag value from code behind.

For this i have added one html page to my solution. Now there is a tag like this
<div id="oauth_pin">
  <p>    
    <kbd aria-labelledby="code-desc"><code>1553677</code></kbd>
  </p>
</div>


Now i am trying to get "code" tag value that is 1553677.

Please let me know how to solve this problem.
Posted

1 solution

hi,
you can set Runat="Server" and id for your tag and then find value of this tag in code Behind :
<kbd aria-labelledby="code-desc"><code id="TagName"  runat="server">1553677</code></kbd>

C#
protected void Page_Load(object sender, EventArgs e)
    {
        string test=TagName.InnerText;
    }
 
Share this answer
 
v4
Comments
Mohamed Mitwalli 25-Apr-12 3:09am    
my +5
hamid-shrk 25-Apr-12 3:37am    
Tank you Mohamed
Mohamed Mitwalli 25-Apr-12 3:41am    
Your welcome :) hamid
skumarn 25-Apr-12 4:51am    
Thank you...
hamid-shrk 25-Apr-12 4:56am    
:)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900