jquery and ajax async post back [closed]
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.
精彩评论