开发者

How do I force a jQuery click event to proceed any control click event on ASP.Net page

I've found posts about making a click开发者_如何学Python event with jQuery for a button, however I need a little more then that.

When any postback occurs on a page, I need to fire off a jQuery click event. Based on a condition, I want to continue processing (including running the server-side event code after the jQuery code), or, perform a redirect.

I'm not quite sure how to go about this.

Your help is appreciated!


If you want to handle every postback, the simplest way to do it is to replace the __doPostBack function with your own wrapper, like this:

var originalDoPostBack = __doPostBack;
__doPostBack = function() { 
    //Run some code
    if(something)
        originalDoPostBack.apply(this, arguments);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜