i am using http://harvesthq.github.io/chosen/ control in drop-down list
. Everything is going good but i am facing a problem like if i am setting the property of dro
Cause: All jQuery plugins are applied on the Page Load event of the HTML Page or in other words document ready event which is fired when the whole page or document is rendered completely in browser. Now jQuery assigns a unique identification to all controls when applying the plugin. But when some control is inside UpdatePanel and a Partial PostBack occurs the Unique Ids assigned by jQuery is lost and hence the plugin stops working
Solution: The solution to this problem is that we need to re-apply the jQuery Plugin every time the UpdatePanel’s Asynchronous request or Partial PostBack is completed. For which we can make use of the event handlers provided by the ASP.Net Framework to detect completion of UpdatePanel’s Asynchronous request or Partial PostBack.
Code
//On UpdatePanel Refresh
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm != null) {
prm.add_endRequest(function (sender, e) {
if (sender._postBackSettings.panelsToUpdate != null) {
for (var selector in config) {
$(selector).chosen(config[selector]);
}
}
});
};
add this to your javascript section