Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've actually found a pretty cool hack which essentially embeds an iframe on the same page as the silverlight application. The iframe contains an aspx webpage which refreshes itself every (Session.Timeout - 1) minutes. This keeps the session alive for however long the silverlight app is open.</p> <p>To do this:</p> <p>Create an asp.net page called "KeepAlive.aspx". In the head section of that page, add this:</p> <pre><code>&lt;meta id="MetaRefresh" http-equiv="refresh" content="18000;url=KeepAlive.aspx" runat="server" /&gt; &lt;script language="javascript" type="text/javascript"&gt; window.status = "&lt;%= WindowStatusText%&gt;"; &lt;/script&gt; </code></pre> <p>In the code behind file, add this:</p> <pre><code>protected string WindowStatusText = ""; protected void Page_Load(object sender, EventArgs e) { if (User.Identity.IsAuthenticated) { // Refresh this page 60 seconds before session timeout, effectively resetting the session timeout counter. MetaRefresh.Attributes["content"] = Convert.ToString((Session.Timeout * 60) - 60) + ";url=KeepAlive.aspx?q=" + DateTime.Now.Ticks; WindowStatusText = "Last refresh " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(); } } </code></pre> <p>Now, on the same page as the silverlight app, add this:</p> <pre><code>&lt;iframe id="KeepAliveFrame" src="KeepAlive.aspx" frameborder="0" width="0" height="0" runat="server" /&gt; </code></pre> <p>Now the asp.net session will remain active while the silverlight app is being used!</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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