How to use __doPostBack()

后端 未结 7 1466
离开以前
离开以前 2020-11-22 04:43

I\'m trying to create an asyncrhonous postback in ASP.NET using __doPostBack(), but I have no idea how to do it. I want to use vanilla JavaScript.

Some

7条回答
  •  执笔经年
    2020-11-22 05:09

    You can try this in your web form with a button called btnSave for example:

    
    
    
    

    And in your code behind add something like this to read the value and operate upon it:

    public void Page_Load(object sender, EventArgs e)
    {
      string parameter = Request["__EVENTARGUMENT"]; // parameter
      // Request["__EVENTTARGET"]; // btnSave
    }
    

    Give that a try and let us know if that worked for you.

提交回复
热议问题