fnagel/jquery-ui — Issue #190: Usage with ASP.NET Ajax
Author: amatuerGeek
Created: 2011-11-13 02:43:24+00:00
State: open

Rather than an issue this is a fix for an issue I found in the code. I didn't know how to post it (I just signed up to post this) so using the issues for that. If am doing anything wrong my apologies first.

Issue:
I had to use the asp.net AJAX update panel without using the jquery ajax callback methods (for some reasons). So inside the update panel I had the custom select menu which at page load initialized properly. But the problem started occurring when my ajax panel was doing callback methods. When the panel got updated on some event the menus would go back to the old HTML look without any customization.

Fix:
This was a small fix actually but had me searching all the posts from top to bottom everywhere. What you have to do is add the following code in the .cs file.
if (Page.IsPostBack)
{
string script = "$('select').selectmenu()";
ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "jscript", script, true);
}

And presto it all started working fine.

A big thanks to all the developers who put in all their hard work for this. Keep up the good work guys :)