1.
将参数保存在Session状态中:
Session["para"] = 参数值;
2.
给按钮添加onclick属性,以打开新的页面:
this.btn.Attributes.Add("onclick","window.open('新页面.aspx','newwin','toolbar=no,menubar=no,status=no,location=no,resizable=no,scrollbars=no,width=380,height=400,top=100,left=200');return false;");
3.
在新页面中将参数值读出:
string str_para = Session["para"].ToString();
将参数保存在Session状态中:
Session["para"] = 参数值;
2.
给按钮添加onclick属性,以打开新的页面:
this.btn.Attributes.Add("onclick","window.open('新页面.aspx','newwin','toolbar=no,menubar=no,status=no,location=no,resizable=no,scrollbars=no,width=380,height=400,top=100,left=200');return false;");
3.
在新页面中将参数值读出:
string str_para = Session["para"].ToString();
解决方案 »
- NET字符串分割
- asp.net 身份验证
- 关于webBrowser控件的按钮提交表单的问题,无法实现按钮登录,SoS
- 为什么从子窗口中传值到父窗口,刷新时会弹出一个窗口呢?
- gridview中怎样为其中的一列加上事件?
- (急急急!~在线等)ASP Treeview 2.0 应用在ASP中产生的问题
- 大家用HTTPREQUEST的异步返回值是怎么处理的呀,我的值老undefined
- oracle的服务都启动了,为什么连不上oracle服务器?请各位帮帮忙阿!十万火急阿!!!
- 请问哪位大侠知道,如果控制回传之后,页面仍然保持原来滚动条的位置?
- 100分求asp.net(c#)源代码!
- 请看看! 在线等待!
- 最近完成个人主页,可惜不知道哪里有免费的Asp.net的空间?
Response.Write("<script language=javascript>window.open('new.aspx?id='"+id+")</script>")
在new.aspx页面上Request["id"].Tostring()即可
2.在子页面中string str=Request["val"];
string str;
str=Request.QueryString["参数名"].ToString();
<input onclick="OpenWindow()" type="button" value="OpenWindow" name="button2">
<script language="javascript">
function OpenWindow()
{
window.open("WebForm1.aspx?[你的参数名]=[你的参数值]","face","width=400,height=300,resizable=0,scrollbars=0,status=0,menubar=0");
}
</script>
方法二:
<a target='_blank' href='WebForm1.aspx?[你的参数名]=[你的参数值]'>查看</a>
<HTML>
<HEAD>
<TITLE>无标题文档</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<form name="form1" method="post" action="" ID="Form1">
<table><tr><td><input type="text" id=mytext name="textfield"> </td><td><a href="#" onclick="document.form1.mytext.value=window.showModalDialog('2.htm','width=20px;height=30px'); ">单击选择客户</a></td></tr></table>
</form>
</BODY>
</HTML> <HTML>
<HEAD>
<TITLE>无标题文档</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<form name="form1" method="post" action="" ID="Form1">
<table><tr><td><input type="text" id=mytext name="textfield"> </td><td><a href="#" onclick="document.form1.mytext.value=window.showModalDialog('2.htm','width=20px;height=30px'); ">单击选择客户</a></td></tr></table>
</form>
</BODY>
</HTML>
2.htm:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function wu(w)
{
window.returnValue = w;
window.close();
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<a href="#" onclick="wu('名字')">名字</a>
</body>
</html>
只要在这个按纽的click事件中加入相应代码即可,假设控件ID为Btn_Popup_Page,需要弹出的页面为newpage.aspx
private void Btn_Popup_Page()
{
string sValue=[***你想传递的值***];
Server.transfer("newpage.aspx?sValue="+sValue.trim());
}谢谢!希望对你有用!
private void btn_Click(object sender, System.EventArgs e)
{
Server.transfer("new.aspx");
}
是怎么回事?
你是不是把t小写了,你写完Server输入.后系统会有提示的啊!
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:HyperLink id="Hyperlink1" NavigateUrl='<%# "Links.aspx?ItemID=" + DataBinder.Eva(Container.DataItem,"id") ' runat="server" ></asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
2)新页面得到该参数:
string idString = "";
if (Request.Params["ItemID"] != null)
idString = Request.Params["ItemID"];
if (idString != "")
{
int id = Int32.Parse(idString);
}