在我的 ASP.Net 网站中,我使用<httpRedirect>
Web 配置将 URL 永久重定向到其他位置。
我正在从表中读取 URL 值并使用Response.Redirect( URL );
它重定向到该 URL,它运行良好。
但是现在当我尝试使用以下方法将参数发送到调用页面时:
Response.Redirect("Default.aspx?name=stackoverflow");
<httpRedirect>
在 web.config 中调用是Default2.aspx
因为 web.config 中的以下代码:
<location path="Default.aspx">
<system.webServer>
<httpRedirect enabled="true" destination="Default2.aspx" httpResponseStatus="Permanent" />
</system.webServer>
</location>
问题是Default2.aspx
没有收到任何参数。
请帮忙。
注意:我不能使用会话变量,因为页面内容取决于该参数。
例如,
如果用户在新选项卡中打开另一个页面,Default.aspx?name=MetaStackOverflow
会话变量将被替换,如果第一页被刷新,那么Stackoverflow
它将显示MetaStackOverflow
.