R
Randall Parker
I'm looking at this web page:
http://www.allasp.net/enterkey.aspx
Where they say:
Remember:
* <asp:Button> controls render as <input type=submit value=xxx> html elements.
* <asp:HtmlInputButton> controls render as <input type=button value=xxx
onclick=__doPostBack(...)> html elements.
* <asp:HtmlButton> controls render as <button onclick=__doPostBack(...)>xxx</button>
Okay, the first case does a submit. The other two cases do the __doPostBack() calls
which presumably also do submits. The main difference between the Button on one hand
and tht HtmlInputButton and HtmlButton on the other hand is that the latter two will
cause IsPostBack to test as true in the CodeBehind. But they all cause a submit, right?
Suppose one wants to have a button that does not cause a submit of the current page
and that instead goes an HTML GET to another URL. Is there a way to do that with some
asp: button control?
What I want to do: have rows in a DataGrid with buttons to click to various other
pages. I guess I could do that via a CodeBehind redirect. But why go thru that
overhead on the server? Doesn't that redirect require an additional handshake between
the browser and server where the server has to tell the browser to do an HTML GET?
So how to describe that buttons in a grid column should go to links without submit
happening?
http://www.allasp.net/enterkey.aspx
Where they say:
Remember:
* <asp:Button> controls render as <input type=submit value=xxx> html elements.
* <asp:HtmlInputButton> controls render as <input type=button value=xxx
onclick=__doPostBack(...)> html elements.
* <asp:HtmlButton> controls render as <button onclick=__doPostBack(...)>xxx</button>
Okay, the first case does a submit. The other two cases do the __doPostBack() calls
which presumably also do submits. The main difference between the Button on one hand
and tht HtmlInputButton and HtmlButton on the other hand is that the latter two will
cause IsPostBack to test as true in the CodeBehind. But they all cause a submit, right?
Suppose one wants to have a button that does not cause a submit of the current page
and that instead goes an HTML GET to another URL. Is there a way to do that with some
asp: button control?
What I want to do: have rows in a DataGrid with buttons to click to various other
pages. I guess I could do that via a CodeBehind redirect. But why go thru that
overhead on the server? Doesn't that redirect require an additional handshake between
the browser and server where the server has to tell the browser to do an HTML GET?
So how to describe that buttons in a grid column should go to links without submit
happening?