asp.net:;服务器&QUOT RUNAT =&QUOT之间的差额;和服务器控件

编程入门 行业动态 更新时间:2024-10-25 09:36:11
本文介绍了asp:;服务器&QUOT RUNAT =&QUOT之间的差额;和服务器控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是什么

<asp:Button id="button1" Text="Click me" runat="server" OnClick="submitEvent" />

<input type="button" id="button1" runat="server" value="Click me" />

是否与=服务器属性,输入有其他的或有限的属性和方法?

Does the input with runat="server" attribute has other or limited properties and methods?

感谢您!

推荐答案

第一个创建了一个 System.Web.UI.WebControls.Button ,而第二个创建 System.Web.UI.HtmlControls.HtmlInputButton 。

The first one creates a System.Web.UI.WebControls.Button while the second one creates a System.Web.UI.HtmlControls.HtmlInputButton.

两者都是服务器控件,但在器WebControls 命名空间的控制一般具有比 HtmlControls 命名空间。通常情况下,他们把一些数据的ViewState 来保持自己的状态跟踪,他们有服务器端回发事件。

Both are server controls, but the controls in the WebControls namespace generally has a bit more functionality than the controls in the HtmlControls namespace. Typically they put some data in ViewState to keep track of their state, and they have server side postback events.

在 HtmlControls 命名空间的每个控制完全对应一个HTML元素,而在器WebControls 命名空间中的控件可能将取决于什么正在请求的页面,浏览器可以支持不同的渲染。

Each controls in the HtmlControls namespace correspond exactly to an HTML element, while the controls in the WebControls namespace may be rendered differently depending on what the browser that is requesting the page can support.

更多推荐

asp.net:;服务器&QUOT RUNAT =&QUOT之间的差额;和服务器控件

本文发布于:2023-06-08 03:53:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/576148.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:服务器   差额   控件   asp   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!