5

私の ASP.Net Web サイトでは<httpRedirect>、Web 構成を使用して URL を他の場所に永続的にリダイレクトしています。
テーブルから URL 値を読み取り、Response.Redirect( URL );
それを使用してその URL にリダイレクトしています。完璧に機能しています。
しかし今、次を使用してパラメーターを呼び出しページに送信しようとすると:

Response.Redirect("Default.aspx?name=stackoverflow");

<httpRedirect>web.config の は、web.configDefault2.aspxの次のコードのために を呼び出します。

<location path="Default.aspx">
    <system.webServer>
        <httpRedirect enabled="true" destination="Default2.aspx" httpResponseStatus="Permanent" />
    </system.webServer>
</location>

問題はDefault2.aspx、パラメーターを受け取らないことです。
助けてください。

注:ページの内容はそのパラメータに依存するため、セッション変数を使用できません。

たとえば、
ユーザーがセッション変数を使用して新しいタブで別のページを開くと、置き換えられ、最初のページが更新されると、コンテンツをDefault.aspx?name=MetaStackOverflow表示する代わりにが表示されます。StackoverflowMetaStackOverflow

4

1 に答える 1

6

特殊文字 $V$Q を忘れずに、exactDestination を True に設定する必要があります。

<location path="Help"> <system.webServer> <httpRedirect enabled="true" destination="/Redirect.aspx$V$Q" httpResponseStatus="Permanent" exactDestination="true" /> </system.webServer> </location>

于 2013-02-11T22:36:10.830 に答える