"Tony Johansson" <(E-Mail Removed)> wrote in message
news:iceeti$uec$(E-Mail Removed)...
> Hello!
>
> What is the difference if I use a ASP web control Button compared to if I
> use a HTML Button.
> Below is two example where the first row is using a ASP web control and
> the second row is using HTML control.
>
>
> <asp:Button ID="Button2" runat="server" Text="Button" />
> input id="Button1" type="button" value="button" />
I'm assuing the missing opening bracket on the second button was a typo.
Probably the main difference between the two is that with the <asp:Button
....> the ASP.NET framework will do a lot of work for you. The framework will
detect if the button has been clicked and call the appropriate handler
(Button2_Click). You also have more control because you can refer to the
button in your code (Button2) and hide it, apply styles to it, change the
text, etc.
If you use a standard HTML control then the end HTML will be very similar,
but at the server you have to do the work to detect whether or not the
button has been clicked. You also loose the ability to change its attributes
in code.
As a rule I'd suggest always using the ASP.NET button.
Hope this helps.
--
Brian Cryer
http://www.cryer.co.uk/brian