开发者

jquery and ajax async post back [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

Hi I am using jquery to have the sliding effect, kwicks effect, slideup and fancybox in a single page. everyhting works perfectly until 开发者_C百科the ajax postback but after that none of the jquery functions seems to work. any ideas will be great


It looks as though your UpdatePanel is breaking your javascript. The key is to remember when it does a postback these are not the same elements that your javascript was originally tied to. Rebinding after the postback will fix your problem; all this requires is tying some javascript calls to a Microsoft provided call back function:

function BindEvents()
{
    //Here your jQuery function calls go
}

var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(BindEvents);

The PageRequestManager will call the BindEvents function after each post back. This can go any where on the page as long as it is there prior to the postback.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜