Tuesday, February 2, 2010

Javascipt code on the pop up page


Button1.Attributes.Add("onclick", "javascript:return closeBrowser(1);");
Button2.Attributes.Add("onclick", "javascript:return closeBrowser(2);");
function for closing the browser and taking the value in a hidden control
function closeBrowser(val)
{
// alert(window.opener.document.forms[0].ctl00_ContentPlaceHolder1_hidValue.value);
// window.opener.document.forms[0].ctl00_ContentPlaceHolder1_hidValue.value = val;
if (val == 1)
{
window.returnValue = true;
this.window.close();
return true;
}
else
{
window.returnValue = false;
this.window.close();
return false;
}
}
////////////////////////in ASPX PAGE on page load////////////////
btnSubmitAll.Attributes.Add("onclick", "var strReturn; strReturn=window.showModalDialog('modalDialog.aspx',null,'status:no;dialogWidth:370px;dialogHeight:220px;dialogHide:true;help:no;scroll:no'); if (strReturn != null) document.forms[0].ctl00$ContentPlaceHolder1$hidValue.value=strReturn;");

No comments:

Post a Comment