按钮和HTML的按钮:ASP的区别 [英] Difference between asp:button and html's button
本文介绍了按钮和HTML的按钮:ASP的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在学习asp.net。我有例如按钮的问题。
I'm learning asp.net. I have question about example buttons
我可以用按钮的两种类型。
I can use two types of button.
<input id="Button1" type="button" value="button" />
或
<asp:Button ID="Button3" runat="server" Text="Button" />
什么是两者之间的主要区别?
What are the main differences between the two?
推荐答案
一个是服务器控件(asp的按钮),当页上呈现包含的JavaScript处理回发的逻辑,以及暴露于你的code-屁股作为控制您可以通过其ID地址。 HTML控件是平台无关,是由您的浏览器渲染成只是一个按钮。该按钮将提高点击事件,但不会发布表单。
One is a server control (the asp button) that when rendered on the page includes javascript that handles the postback logic, as well as being exposed to your code-behinds as a control you can address by its ID. The Html control is platform agnostic, and is rendered by your browser as just a button. That button will raise click events but will not POST your form.
这篇关于按钮和HTML的按钮:ASP的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文