Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP web control and HTML

Reply
Thread Tools

ASP web control and HTML

 
 
Tony Johansson
Guest
Posts: n/a
 
      11-22-2010
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" />

//Tony


 
Reply With Quote
 
 
 
 
Brian Cryer
Guest
Posts: n/a
 
      11-23-2010
"Tony Johansson" <> wrote in message
news:iceeti$uec$...
> 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

 
Reply With Quote
 
 
 
 
Cubaman
Guest
Posts: n/a
 
      11-24-2010
On Nov 23, 1:29*pm, "Brian Cryer" <not.h...@localhost.invalid> wrote:
> "Tony Johansson" <johansson.anders...@telia.com> wrote in message
>
> news:iceeti$uec$...
>
> > 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


Hello:
I agree with your explanation, but if you are not going to use any of
the benefits of aspnet controls, it's better to use html one's and
release server resources that otherwise will be wasted.
Best regards.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Some question about web control and the old HTML control Tony Johansson ASP .Net 2 12-01-2010 12:17 PM
HTML Control and ASP.Net control question =?Utf-8?B?YW1qYWQ=?= ASP .Net 1 06-19-2006 02:08 PM
Help on HTML server control vs HTML control =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?= ASP .Net 5 09-15-2005 07:51 PM
accessing the web user control's control from a web page and set a value from another web page Reny J Joseph Thuthikattu ASP .Net 1 12-30-2004 12:21 PM
HTML Client Control versus. HTML Server Control versus. Web Server Control Matthew Louden ASP .Net 1 10-11-2003 07:09 PM



Advertisments