Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

How to use html tags in c# asp.net?

I don't want to use Asp tags in c# asp.net.

Please help me.

Thanks in Advance.

Ankit Agarwal
Website Application Developer
Posted
Updated 15-Jan-14 19:42pm
v2
Comments
Goenitz 16-Jan-14 1:46am    
what exactly will you be doing with html tags?
sameer549 16-Jan-14 1:46am    
code behind file means the file in which u implement code logic, in code behind file u can use only c#.net and vb.net. In designing u can use html tags instead of asp tags, but for calling events u may need some additional logic
[no name] 16-Jan-14 1:48am    
Code behind means C#

1 solution

The HTML server controls are basically the original HTML controls but enhanced to enable server side processing. The HTML controls like the header tags, anchor tags and input elements are not processed by the server but sent to the browser for display.

They are specifically converted to a server control by adding the attribute runat="server" and adding an id attribute to make them available for server-side processing.
For example, consider the HTML input control:
HTML
<input type="text" size="40"></input>


It could be converted to a server control, by adding the runat and id attribute:
ASP.NET
<input type="text" id="testtext" size="40" runat="server"></input>


Please check this link
http://www.w3schools.com/aspnet/aspnet_refhtmlcontrols.asp
 
Share this answer
 
Comments
[no name] 16-Jan-14 1:49am    
How can i call this text in c#?
Sandeep Singh Shekhawat 16-Jan-14 2:12am    
I have defined runat="Server" in html server control so you can get its id on code behind file and after that you can get its value like.

string message = testtext.Value;

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