Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to return date from popup window Contains a grid from external form , i want when i select row from grid return value to text pox on the main page and close the popup window .
Posted
Comments
Nilesh Patil Kolhapur 19-Mar-12 5:52am    
give ur code to get exact solution :)

1 solution

try this

//page load
 if (Session["CategCode"] != null)
            {
               Hiddenfield.Value=Session["CategCode"].ToString();
             }
//in parent page button click event

ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myscript", "window.open('CategoryList.aspx','','width=530,height=450,toolbar=no,resizable=no,location=center,status=no');", true);
//popup page after selecting grid ok button event
if(string.IsNullOrEmpty(HiddenField1.Value))
{
Session["CategCode"] = HiddenField1.Value;
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "A", "<script>window.opener.document.forms[0].submit();window.close();</script>");
}
else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>alert('Please Select any Value')</script>");
                return;
            }
 
Share this answer
 

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