打开新页面后,参数该如何获取?

ajo413 2013-02-25 04:21:38
用以下代码打开一个新页面,不覆盖原来的页面



string p = "testp";

Response.Write("<script>window.open('test.aspx?testa =" + p + "','_blank','alwaysLowered = yes ,top=0,left=0')</script>");



在test.aspx.cs中,想要获得参数testa的值,该怎么表示呢?
Request.QueryString["testa"].ToString();使用这样的,会报错,未将对象引用设置到对象的实例

那我要怎么获得testa的值呢?
...全文
212 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
ajo413 2013-02-25
  • 打赏
  • 举报
回复
引用 4 楼 Chinajiyong 的回复:
引用 3 楼 ajo413 的回复:引用 1 楼 Chinajiyong 的回复:是应该用Request.QueryString["testa"].这个获取,是不是哪有空格什么的 地址栏的内容是:http://localhost:3021/***/test.aspx?testa =testp 请问,有什么问题吗? string p = "testp";……
真的是这样,好坑爹的原因 结账了~~
EnForGrass 2013-02-25
  • 打赏
  • 举报
回复
引用 3 楼 ajo413 的回复:
引用 1 楼 Chinajiyong 的回复:是应该用Request.QueryString["testa"].这个获取,是不是哪有空格什么的 地址栏的内容是:http://localhost:3021/***/test.aspx?testa =testp 请问,有什么问题吗?
string p = "testp"; Response.Write("<script>window.open('test.aspx?testa=" + p + "','_blank','alwaysLowered = yes ,top=0,left=0');</script>"); 红色部分不能有空格
ajo413 2013-02-25
  • 打赏
  • 举报
回复
引用 1 楼 Chinajiyong 的回复:
是应该用Request.QueryString["testa"].这个获取,是不是哪有空格什么的
地址栏的内容是:http://localhost:3021/***/test.aspx?testa =testp 请问,有什么问题吗?
ajo413 2013-02-25
  • 打赏
  • 举报
回复
引用 1 楼 Chinajiyong 的回复:
是应该用Request.QueryString["testa"].这个获取,是不是哪有空格什么的
代码就是我贴上的那样呢,我看不出有空格
EnForGrass 2013-02-25
  • 打赏
  • 举报
回复
是应该用Request.QueryString["testa"].这个获取,是不是哪有空格什么的

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧