Forum Moderators: open

Message Too Old, No Replies

.NET submissions

how does it know which button?

         

RossWal

11:04 pm on Dec 18, 2002 (gmt 0)

10+ Year Member



If you place 2 web form buttons on a page in VisualStudio.net, the rendered HTML has 2 submit buttons on the form. There is nothing client side that communicates which button was pressed. Apparently the information is communicated to the server automatically in the http post. Presumably this would be the case for ASP or any other server. I guess I've never looked at multiple Submit buttons before. Does anyone know how this works?

Thanks,
Ross

Xoc

9:31 pm on Dec 19, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The easy way to tell what is submitted is to view the source on the page and make a copy of it. Post the source as a separate html page. Change the method attribute on the form from "post" to "get". The querystring will show you what is actually posted up to the server in the query string.

Or just paste this code into an html page and test it.


<form action="foo.htm" method="get">
<input type="submit" name="a"></input>
<input type="submit" name="b"></input>
</form>

RossWal

11:27 pm on Dec 20, 2002 (gmt 0)

10+ Year Member



Makes perfect sense. But I never would have thunk to try it. Thanks!