How to use __doPostBack()

后端 未结 7 1465
离开以前
离开以前 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:13

    I'd just like to add something to this post for asp:button. I've tried clientId and it doesn't seem to work for me:

    __doPostBack('<%= btn.ClientID%>', '');
    

    However, getting the UniqueId seems to post back to the server, like below:

    __doPostBack('<%= btn.UniqueID%>', '');
    

    This might help someone else in future, hence posting this.

提交回复
热议问题