假設ParentForm
點擊Open按鈕彈出SubForm
點擊Close按鈕關閉SubForm
父窗體前台代碼
function OpenSubForm(ret) {
var strPath = "subForm
var nHeight =
var nWidth =
var feature
feature = "Height= " + nHeight + "
feature += "
window
return false;
}
</script>
父窗體後台代碼
{
// ペ?ジを初期化するユ?ザ? コ?ドをここに?啡毪筏蓼?br /> this
}
子窗體後台代碼
private void Button
{
string strScript =string
string strRetForm = String
string strRetValue=String
strRetForm=Request
strRetValue=Request
if (strRetForm == string
{
strRetForm= "document
}
strScript = "<script language=javascript>";
strScript += "window
strScript += "
strScript += "window
strScript += "</script>";
Response
}
上面是js其實也就是頁面傳值了
頁面間傳值的幾種方式
下面的代碼片斷演示了如何實現這個方法
源頁面WebForm
{
string url;
url="WebForm
Response
}
目標頁面WebForm
private void Page_Load(object sender
{
Label
Label
}
使用Session變量
源頁面WebForm
{
//textbox
//controls
Session["name"]=TextBox
Session["email"]=TextBox
Server
}
目標頁面WebForm
{
Label
Label
Session
Session
}
From:http://tw.wingwit.com/Article/program/net/201311/14183.html