Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris - 10 Jun 2007 18:31 GMT
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
Eliyahu Goldin - 10 Jun 2007 19:37 GMT
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.

Signature

Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin

> Hi,
>
[quoted text clipped - 7 lines]
> Thanks
> Chris
bruce barker - 11 Jun 2007 06:23 GMT
only the html form controls <input type=submit> or <input type=image>
postback. the <input type=button> is for firing client events without a
postback.

-- bruce (sqlwork.com)

> 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.
Göran Andersson - 11 Jun 2007 05:10 GMT
> Hi,
>
[quoted text clipped - 7 lines]
> 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.

Signature

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

Chris - 11 Jun 2007 08:00 GMT
Thanks

>> Hi,
>>
[quoted text clipped - 14 lines]
> to add some Javascript in the onclick event for it to actually do anything
> at all.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.