【发布时间】:2010-10-08 13:13:28
【问题描述】:
我正在使用下面的代码在asp.net中对一个页面的body参数添加一系列调用:
uxBodyTag.Attributes["onbeforeunload"] +=
"ajaxRequest('UnlockQuery.ashx?QueryID=" + queryId.ToString() +
"&UserID=" + Session["UserID"].ToString() + "');";
这被渲染为:
<body id="uxBodyTag" onbeforeunload=
"ajaxRequest('UnlockQuery.ashx?QueryID=176&UserID=11648');">
&意味着我的 ashx 页面没有检索到正确的变量 - 我怎样才能阻止 asp.net 这样做?
编辑:
使用 Server.UrlEncode 给了我以下内容:
<body id="uxBodyTag" onbeforeunload=
"ajaxRequest('UnlockQuery.ashx%3fQueryID%3d179%26UserID%3d11648')%3b">
这更糟糕。
【问题讨论】:
标签: asp.net url parameters get