How does IsPostback technically work?

前端 未结 3 493
遥遥无期
遥遥无期 2020-12-01 11:26

I\'m currently having a strange issue whereby all browsers except from Google Chrome are registering a call to IsPostback within a Page_Load event as true when I click an as

3条回答
  •  抹茶落季
    2020-12-01 12:07

    Postback actually works fairly simply by submitting the form to itself (for the most part). The javascript code is actually put on your page:

    
    
    
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
    

    Marks answer shows you the server side code that is run.

提交回复
热议问题