By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,969 Members | 1,536 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,969 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.