Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a custom multiselect control am trying to close it if user clicks else where on a page after selecting the items and forcing a postback to trigger onchange event of it. it works as expected as long as there are no jquery references on a page. I have a helpcontrol where am addding two jquery references to show a tooltip then dopostback is not working.
Here is my code,
C#
private static string doPostBackWhenDropdownCloses(string clientId, string divID, string postBackHiddenField)
{
   string strScript = "$(document).click(function() {" +
                      "debugger;"+
                      "if(document.getElementById('" + postBackHiddenField + .value=='1') {" +
                      " document.getElementById('" + postBackHiddenField + "').value='0';" +
                      "   $('#" + divID + "').hide( function(){" +
                      "   javascript: __doPostBack('" + clientId + "',''); " +
                      "   });" +
                        "}" +
                       "});";
   return strScript;
}
Posted
Updated 23-Feb-14 18:31pm
v4
Comments
Can you create a fiddle at http://jsfiddle.net/[^]?
Maarten Kools 24-Feb-14 0:49am    
Try specifying jquery.noConflict()[^]. And then instead of $(document) (and others) as jQuery(document). Both jQuery and Microsoft use the $ symbol as an alias in their libraries.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900