Click here to Skip to main content
15,895,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to hide the Popup control extender when i select the value in dropdown Otherwise the Popup will show... Pls Help Me
Posted
Updated 30-Oct-12 21:07pm
v2
Comments
Sandeep Mewara 31-Oct-12 3:07am    
Good to know. Now, what is the issue? Where are you stuck? What have you tried so far?
durga.r 31-Oct-12 3:23am    
In my Application I used PopupControl Extender for help text..... If i choose "yes" in dropdown means popup control will show... "no" means it will hide(I used PopupControl Extender for each textbox)

1 solution

To hide it with javascript, first assign a behaviorID to the extender. Then use the following code to close it.

your popup extender tag:

XML
<ajaxToolkit:PopupControlExtender ID="PopupControlExtender1" BehaviorID="pop" runat="server" PopupControlID="Panel1" TargetControlID="Button1">
     </ajaxToolkit:PopupControlExtender>


call hide() functipon in onChange event of your drop down.

JavaScript
function hide()
{
     var e = document.getElementById("dropdown_Id");
     var strUser = e.options[e.selectedIndex].value;
     //i ssumed first element should be blank
     if(strUser!='')
     {       
        var bh = $find("pop");
        bh.hidePopup();
     }
     else
     {
        return false;
     }
}
 
Share this answer
 
Comments
durga.r 31-Oct-12 4:49am    
I tried this but its not working
Kaushikhalvadiya 31-Oct-12 15:10pm    
added jquery reference?

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