Note that there are some explanatory texts on larger screens.

plurals
  1. POResponse.Redirect in ASP.NET AJAX calls
    text
    copied!<p>I have a button in an UpdatePanel that if it is clicked will redirect the user to another page in the same folder in some cases and otherwise will update the UpdatePanel with some info. If I do a redirect in this way:</p> <pre><code>Response.Redirect("Test.aspx"); </code></pre> <p>it does a redirect to /Test.aspx which in most cases would be fine, but the problem is that the application is accessed through a reverse proxy (at x.com/y/) which will cause some problem since /Test.aspx will redirect the user to a nonexisting file in the root of the server that does the proxying. </p> <p>Is it possible to force the redirect to skip the / stuff since it is not necessary in this case, since both files are in the same folder. </p> <p>Edit: Code sample</p> <pre><code>&lt;asp:ScriptManager ID="script" runat="server" /&gt; &lt;asp:UpdateProgress ID="prog" runat="server" AssociatedUpdatePanelID="up"&gt; &lt;ProgressTemplate&gt; &lt;h1&gt;Waiting...&lt;/h1&gt; &lt;/ProgressTemplate&gt; &lt;/asp:UpdateProgress&gt; &lt;asp:UpdatePanel ID="up" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true"&gt; &lt;ContentTemplate&gt; &lt;asp:TextBox ID="txt" runat="server" /&gt; &lt;asp:Button ID="btn" runat="server" OnClick="click" Text="Button" /&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>Click method:</p> <pre><code>protected void click(object sender, EventArgs e) { Thread.Sleep(3000); if (txt.Text == "redirect") Response.Redirect("Test.aspx"); else txt.Text = ""; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload