browser don't know if you have specified runat=server

T

Tony Johansson

I just wonder if you use a html control and add runat=server to html control
making it a html server control.
I assume that the browser doesn't know if you have specified runat=server or
not.
Is that correct understood ?

//Tony
 
G

Gregory A. Beamer

ASP.NET, essentially, does one thing: it responds to requests from web
browsers and sends back responses to them in the form of an HTML
stream.

All of the various Web controls and HTML controls are merely guides to
ASP.NET to describe how it should construct that HTML stream.

The web browser has not the slightest notion of how you have written
the markup and code-behind - all it knows how to do is to receive an
HTML stream and render it to the user.

The issue here comes from another thread. The OP is trying to use an
input type="button" control and make it act like an asp:Button. The
issue is he also wants to run javaScript along with the server routine.
I have solved it here:
http://tinyurl.com/ylq3gn8

I attempted to solve the HTML button, but it appears the solution there
is to pull the response collection, as ASP.NET (at least not 3.5 (which
likely means 2.0 or greater)) does not link up HTML buttons
automagically when runat = server is used. I think it has to to with the
hidden tag that confirms the element is correct before submitting back
to the routine.

if the OP comes back with a "using asp:Button is unacceptable", then I
can dig deeper into HTML controls. Otherwise, it is probably solved
already with the link.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
G

Gregory A. Beamer

That's the thing - none of this is necessary at all with <asp:Button
/> and its OnClick and OnClientClick events...

I see no reason the <asp:Button> is out, personally.

I have not been able to get OnClientClick to work with the scenario the
OP is envisioning. I would have added that option to the blog entry if I
had gotten it to work.

I don't understand the need to use <input> personally. With ASP.NET 1.0,
you could easily mimick what the <asp:Button> was doing, but we now have
the event validation, which munges things up a bit.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top