Hi Folks I have an updatepanel which contains a linkbutton(such as lnk1) and a panel(such as panel1) . everytime user clicks the link1 , a certain usercontrol (such as uc1) loaded dynamically in panel1 . In uc1 , I have a modalpopup that fires by a button in uc1 . I want in modalpopup when user clicks background , the modalpopup hide . I know the javascript code for this but don't know where place it . The javascript code is :
var backgroundElement = $get("<%= modalpopup.ClientID %>_backgroundElement");
$addHandler(backgroundElement, 'click', hidemodalpopup);
function hidemodalpopup(){
var modalpopup = $find("<%=modalpopup.ClientID %>");
modalpopup.hide();
}
I want to know where these codes should be placed to run properly . Thanks in advance .