When it can be required to use an HTML button instead of a Button Control in asp.Net?
Are there any reasons you may be forced to use the HTML button instead of a button web开发者_如何学编程 control in asp.Net?
You will definitely not be forced IMO. But if your button is executing a client side code and does not require a post back, you can simply use a simple HTML button. The ASP .NET button is ultimately a conventional html button triggered to cause a post back when clicked.
Also by using a simple HTML button, you would lose the ability to change its style/behavior in the server side, easily.
The asp.net button renders as an HTML button. It is important to understand that asp.net controls are ultimatly rendered as HTML. Your browser does not render asp.net controls, only HTML. What using a server-control does is implement the javascript needed in order to allow the server-side functionality automaticlly for you.
Maybe this will be interesting to you
http://www.extremeexperts.com/Net/FAQ/DiffBetweenServerandHTMLControls.aspx
ASP.Net Button controls provides much more functionality rather than Html button controls.
Like as
1) We can set SkinId/CommandName/CommandArgument/ValidationGroup .... etc
property with ASP.Net Button controls but HTML Button does not provide these property.
Yes here agree asp.net controls are ultimately rendered as HTML.
精彩评论