当前位置:跳过导航链接计算机毕业设计首页 : 技术应用 : 详细内容

关于页面之间传递多个参数的功能

来源:本站原创 作者:管理员 添加时间:2011-05-28 点击数:1775

1、相关介绍:

本文介绍主页面与子页面之间传递多个参数的调用模式:

主页面:(在Load事件中增加窗体模式调用子页面)

以下是引用片段:

  protected void Page_Load(object sender, EventArgs e)
    {
        Button1.Attributes.Add("onclick", "var st = window.showModalDialog('Yp.aspx','参数','dialogHeight: 220px;status: no;');if(st!= null){ document.all('TextBox1').value+=st[0];document.all('TextBox2').value+=st[1]; };return st;");       
    }

//将返回值以数组的形式显示

子页面:

以下是引用片段:

 protected void Button1_Click(object sender, EventArgs e)
    {
        string scode = "var arr=new Array();arr[0]='" + TextBox1.Text + "';arr[1]='" + TextBox2.Text + "';window.parent.returnValue=arr;window.parent.close();";
        string script = string.Format("", scode);
        Page.RegisterStartupScript("close", script);
    }

//点击子页面提交按钮后将子页面中的Textbox1.Text值和TextBox2.Text值传递给主页面

注:一定要在弹出的子页面中的中增加以下代码:   否则会弹出多余窗体。

<责任编辑:计算机毕业设计网(http://www.xiaoniu168.com)>

第1页

【联系方式】

【本站信誉】

用心做计算机毕业设计论文网