Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You could always store when tabs are opened and closed in the session. Then when the page is visited again you can check if each tab is listed as being open in the session and if it is re-open it.</p> <p><strong>EDIT</strong></p> <p>Its difficult to give you entire code snippets that answer your problem completely because I haven't got access to your code base. But it would be something like this.</p> <pre><code>&lt;ul id="tabs"&gt; &lt;li onclick="$.get("SaveTab.ashx?tab=1");"&gt;Tab 1&lt;/li&gt; &lt;li onclick="$.get("SaveTab.ashx?tab=2");"&gt;Tab 2&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Then in the SaveSession handler</p> <pre><code>&lt;%@ WebHandler Language="C#" Class="SaveTab" %&gt; using System; using System.Web; public class SaveTab: IHttpHandler, System.Web.SessionState.IRequiresSessionState { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/plain"; if (HttpContext.Current.Request.QueryString["tab"] != null) { HttpContext.Current.Session["OpenTab"] = HttpContext.Current.Request.QueryString["tab"]; } } public bool IsReusable { get { return false; } } } </code></pre> <p>Then in the ASPX output some Javascript that selects the tab. Notice that I am outputting the session value.</p> <pre><code>$(document).ready(function() { $('#tabs').tabs('select', &lt;%= SESSION["OpenTab"]%&gt;); }); </code></pre> <p>I hope this is enough for you to get the general idea, I can't obviously tell you exactly what to do just show you a good approach.</p>
 

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