Why doesn't this button trigger a triple postback?
We developed a page with asp.net and we are debugging it by accident, we found on our page a button with the following onclik attribute code
onclick="__doPostBack('ctl00$FormPlace$m_userTaskMarkAsUnreadButton',''); __doPostBack('ctl00$FormPlace$m_userTaskMarkAsUnreadButton','');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$FormPlace$m_userTaskMarkAsUnreadButton", "", true, "", "", false, false))"
The button seems to do three postbacks, but when we click on it, it only triggers the postback. With this code, it looks like the button will trigger three postbacks.
We'll try it with Internet Explorer and Firefox, and the button always triggers a postback. Will browsers avoid the button doing three postbacks? Or an Asp.net server that avoids three postbacks? We don't understand why the button behaves correctly if the onclick attribute has three calls to make Postbacks.
thanks
a source to share
I know I'm reinventing the wheel here ... but __doPostBack actually .. does a postback , so when the first __doPostBack is executed, the youre on page has already gone.
And btw, doing it like this sounds very tricky. Why not call one method and do it 3 times in the background?
Also .. depends on whether you are using UpdatePanels ..
a source to share