我如何从弹出窗口返回日期 [英] how i can return date from popup window
本文介绍了我如何从弹出窗口返回日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从弹出窗口中返回日期包含一个来自外部表单的网格,我想要当我从网格返回值中选择行返回主页上的文本pox并关闭弹出窗口时.
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 .
推荐答案
尝试一下
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;
}
这篇关于我如何从弹出窗口返回日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文