如何在asp.net中使用c#代码中的html标签? [英] How to use html tags in c# code behind in asp.net?

查看:97
本文介绍了如何在asp.net中使用c#代码中的html标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



如何在c#asp.net中使用html标签?



我不喜欢我想在c#asp.net中使用Asp标签。



请帮帮我。



谢谢提前。



Ankit Agarwal

网站应用程序开发人员

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

推荐答案

HTML服务器控件基本上是原始HTML控件,但增强了以启用服务器端处理。标题标签,锚标签和输入元素等HTML控件不由服务器处理,而是发送到浏览器进行显示。



它们专门转换为服务器通过添加属性 runat =server并添加 id 属性来使其可用于服务器端处理。

例如,考虑HTML输入控件:

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:
<input type="text" size="40"></input>





可以通过添加runat和id属性将其转换为服务器控件:



It could be converted to a server control, by adding the runat and id attribute:

<input type="text" id="testtext" size="40" runat="server"></input>





请查看此链接

http://www.w3schools.com/aspnet/aspnet_refhtmlcontrols.asp



Please check this link
http://www.w3schools.com/aspnet/aspnet_refhtmlcontrols.asp


这篇关于如何在asp.net中使用c#代码中的html标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆