Hi,
I'm working on detected Expired Session during the Async Post back of WRAP.
In usual manner i redirect the response to another page e.g ExpiredSession.aspx. this stops the execution of previous page. but in case of Async Postback of WARP i cant redirect and even i cant stop the processing of current Page's response.
i digged into WRAP and CallbackManager and found that we can use CallbackManager.AddScriptBlock to redirect using Javascript. but how to stop the processing of current page response..... No Ideas.
If somebody has done anything about it i always like such people
Thanks
Hi Imranfazli
Have you found a solution for this issue???? I have exactly the same problem and I cannot find any solution from the infragistic web site.... After the session is expired the warp does not redirectme to the login page unless that i refresh the entired page.
David and Jorge from ANS
I am not sure which exactly scenario you need to implement, so I assume following. You have WARP which has some content/action activated by StartSession. That action can be completed by user on UserAction (successful end dialog/session). If UserAction never happens, then FullPostBack action should be triggered.
Below is suggested implementation. On start of action/dialog it sets end-up timer which calls FullPostBack. If user action happened before, then FullPostBack action is disabled. Any or all "buttons" can be hidden or represented by other controls/elements.All that can be implemented completely on client, completely on server or mixed (as below). But in any case in order to redirect,- a full postback is required.
aspx:
<script type="text/javascript">function endMySession(){ var submitButton = document.getElementById('FullPostBack'); if(submitButton && !window.cancelMyPostBack) submitButton.click();}</script><igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" style="border:1px solid red"> <asp:Button ID="StartSession" runat="server" Text="StartSession" onclick="StartSession_Click" /> <asp:Button ID="UserAction" runat="server" Text="UserAction" onclick="UserAction_Click" /></igmisc:WebAsyncRefreshPanel><asp:Button ID="FullPostBack" runat="server" Text="FullPostBack" onclick="FullPostBack_Click" />
cs:
protected void FullPostBack_Click(object sender, EventArgs e){ // string js = "<script type='text/javascript'>window.location='http://www.google.com'</script>"; // LiteralControl lc = new LiteralControl(js); // this.WebAsyncRefreshPanel1.Controls.Add(lc);}
I do not know why it fails. Maybe request or response failed. To test if there are no error in async postback, you may debug by changing a visible property in any control located in WARP. For example, instead of AddScriptBlock, call something like Button1.Text += "+";If text of button was not changed after async postback, then there is probably exception.
Hi Viktor,
I am new to WARP control and have problem with it, With the help of your code
Infragistics.WebUI.Shared.CallBackManager.AddScriptBlock(this, this.WARPShippingMethod, "alert('Message"');");
I am able to display javascript alert message in my local and testing server but problem starts when I deployed this code on production, Now behavior changed ....no response from that code. (: