469,653 Members | 1,803 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,653 developers. It's quick & easy.

why does HTML input button with runat="server" not cause postback?

Hi,

i 'm experimenting with postback and i tried that with a button server
control and an Html input button but with runat="server".

The button server control causes a postback, but not the Html input button
with runat="server".

Can someone explain me why (because it's running on the server)?
Thanks
Chris
Jun 10 '07 #1
4 12889
runat="server" makes the control available for asp.net in the page life
style, that is between the http request arrival and rendering the resulting
html. It doesn't effect any client-side behavior. Button server control
initiates postbacks not because of runat="server". Rather it comes with some
built-in client-side code.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Chris" <cc@dd.ddwrote in message
news:e2**************@TK2MSFTNGP03.phx.gbl...
Hi,

i 'm experimenting with postback and i tried that with a button server
control and an Html input button but with runat="server".

The button server control causes a postback, but not the Html input button
with runat="server".

Can someone explain me why (because it's running on the server)?
Thanks
Chris


Jun 10 '07 #2
Chris wrote:
Hi,

i 'm experimenting with postback and i tried that with a button server
control and an Html input button but with runat="server".

The button server control causes a postback, but not the Html input button
with runat="server".

Can someone explain me why (because it's running on the server)?
Thanks
Chris
The Button control is rendered as an input with type="submit" in the
html code, that's why it's doing a postback.

The html input with type="button" doesn't do anything by itself. You
have to add some Javascript in the onclick event for it to actually do
anything at all.

--
Göran Andersson
_____
http://www.guffa.com
Jun 11 '07 #3
only the html form controls <input type=submitor <input type=image>
postback. the <input type=buttonis for firing client events without a
postback.

-- bruce (sqlwork.com)

Eliyahu Goldin wrote:
runat="server" makes the control available for asp.net in the page life
style, that is between the http request arrival and rendering the resulting
html. It doesn't effect any client-side behavior. Button server control
initiates postbacks not because of runat="server". Rather it comes with some
built-in client-side code.
Jun 11 '07 #4
Thanks

"Göran Andersson" <gu***@guffa.comschreef in bericht
news:uC**************@TK2MSFTNGP04.phx.gbl...
Chris wrote:
>Hi,

i 'm experimenting with postback and i tried that with a button server
control and an Html input button but with runat="server".

The button server control causes a postback, but not the Html input
button with runat="server".

Can someone explain me why (because it's running on the server)?
Thanks
Chris

The Button control is rendered as an input with type="submit" in the html
code, that's why it's doing a postback.

The html input with type="button" doesn't do anything by itself. You have
to add some Javascript in the onclick event for it to actually do anything
at all.

--
Göran Andersson
_____
http://www.guffa.com

Jun 11 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Tim Mulholland | last post: by
3 posts views Thread by Libra Blue | last post: by
6 posts views Thread by Martin Eyles | last post: by
reply views Thread by Bob | last post: by
19 posts views Thread by Scott M. | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.