How can I use the button tag with ASP.NET?

Although you say that using the [button runat=”server”] is not a good enough solution it is important to mention it – a lot of .NET programmers are afraid of using the “native” HTML tags…

Use:

<button id="btnSubmit" runat="server" class="myButton" 
    onserverclick="btnSubmit_Click">Hello</button>

This usually works perfectly fine and everybody is happy in my team.

Leave a Comment