Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Create two different pages your target page which here is <strong>MyPage.aspx</strong>, and as you yourself have mentioned, a temp page like <code>Temp.aspx</code>. Use a flag to check if your client-side task is done, in the session scope. like:</p> <p>Session["AjaxCallIsDone"]</p> <p>in your your <strong>MyPage Page_Load</strong> method, check if it is true:</p> <pre><code>If(Session["AjaxCallIsDone"] == null || !(Boolean)Session["AjaxCallIsDone"]) Response.Redirect ("Temp.aspx"); </code></pre> <p>Ok then, now it goes to the temp page if your ajax call hasn't been done yet.</p> <p>using jQuery or raw javascript, create your ajax call in the temp page:</p> <pre><code>request = $.ajax({ url: "third-party-server-url", type: "POST",//or may be GET data: yourdata }); request.done(function (response, textStatus, jqXHR){ //your client-side task is done }); </code></pre> <p>create a <code>Handler</code> or <code>Generic Handler</code> to let client inform the server about the ajax call and to set the <code>AjaxCallIsDone</code> flag, do this in your handler method;</p> <pre><code>Session["AjaxCallIsDone"] = true; </code></pre> <p>then in your request callback create another ajax call to call that <code>Handler</code>, then in handlerRequest callback function do your redirect like this:</p> <pre><code>request = $.ajax({ url: "third-party-server-url", type: "POST",//or may be GET data: yourdata }); request.done(function (response, textStatus, jqXHR){ //your client-side task is done var handlerRequest = $.ajax({ url: "your-handler-url", type: "GET" }); handlerRequest.done(function (response, textStatus, jqXHR){ document.location="MyPage.aspx"; }); }); </code></pre> <p>and now all is done.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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