怎样得到脚本传来的值

yzaiml 2007-04-24 02:10:15
td=document.createElement("td");
a=document.createElement("a");
text=document.createTextNode("编辑");
a.appendChild(text);
a.href="javascript:EditPolicy("+datatable.Rows[i].PolicyKey+")";
td.appendChild(a);
tr.appendChild(td);

TablePolicy.appendChild(tr);
}
}
}
}
function EditPolicy(id)
{
if(Sell_Default.GetItemPolicy(id).value)
{
if (window.navigator.appVersion.indexOf("MSIE")!=-1)
{
window.showModalDialog( "EditPolicy.aspx", id, "dialogWidth:1014px;dialogHeight :700px;help: no; status: no; scroll: yes;");
}
else
{
window.open("EditPolicy.aspx", id, "Width=700px;Height=500px;help=no; status=no; scroll=yes;");
}
}
}

我在EditPolicy.aspx.cs里面怎样得到PolicyKey?
...全文
194 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
shaohaiou 2007-04-24
  • 打赏
  • 举报
回复
不是说参数已经传过来了吗,那怎么还得不到值?
传过来了就用Request.QueryString["id"]获得,如果要转成int就用Convert.ToInt32(Request.QueryString["id"])
glamorsunny 2007-04-24
  • 打赏
  • 举报
回复
判断一下传过来了没有

if(Request.QuertyString["id"]==null)
{
Response.Write("true");
}
else
{
Response.Write("false");
}
yzaiml 2007-04-24
  • 打赏
  • 举报
回复
string id=Request.QueryString["id"].ToString();
我传的是int
该了过来也不行 得不到值
shaohaiou 2007-04-24
  • 打赏
  • 举报
回复
Request.QueryString["id"]
清风道禅 2007-04-24
  • 打赏
  • 举报
回复
window.open("<%# "Product.aspx?id="+DataBinder.Eval(Container, "DataItem.Productid") %>","","width=500 height=400")' target=_blank ;>


这句话可能对您有所帮助
glamorsunny 2007-04-24
  • 打赏
  • 举报
回复
window.showModalDialog( "EditPolicy.aspx?id=" + id, id, "dialogWidth:1014px;dialogHeight :700px;help: no; status: no; scroll: yes;");


EditPolicy.aspx.cs里
string id=Request.QueryString["id"].ToString();
yzaiml 2007-04-24
  • 打赏
  • 举报
回复
参数已经传过来了
a.href="javascript:EditPolicy("+datatable.Rows[i].PolicyKey+")";
是要怎样在EditPolicy.aspx.cs里面得到
shaohaiou 2007-04-24
  • 打赏
  • 举报
回复
window.showModalDialog( "EditPolicy.aspx?id=" + id, "dialogWidth:1014px;dialogHeight :700px;help: no; status: no; scroll: yes;");
ychangh 2007-04-24
  • 打赏
  • 举报
回复
get方法
olanty 2007-04-24
  • 打赏
  • 举报
回复
用Url传递参数呗。
auqcesse 2007-04-24
  • 打赏
  • 举报
回复
地址栏传参呀

62,244

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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