It sounds like you want the two things I wanted when I worked through this problem yesterday: (1) ability to specify a starting tab, and (2) control of which tab opens after a postback from the page. One approach: include a hidden field in your .aspx:
<asp:HiddenField runat="server" ID="hfLastTab" Value="0" />
(assuming the first/0th tab is your default if nothing's specified). In Page_Load(), provide a !Page.IsPostBack branch to parse a querystring parameter, and set the hidden field's value:
if (!Page.IsPostBack) {
string pat = @"t=(\d)";
Regex r = new Regex(pat, RegexOptions.IgnoreCase);
Match m = r.Match(Request.Url.Query);
if (m.Success) hfLastTab.Value = m.Groups[0].ToString();
}
Finally, the jQuery ready function tells which tab to show, based on the hiddenfield's value:
$(function () {
$("#tabs").tabs({ active: <%= hfLastTab.Value %> });
});
The server-side postback handling code likewise can set hfLastTab.Value to the appropriate index. If your modal popup can be raised by more than one tab, and you don't know by the control which tab you want to open, you'll have to do a bit more work. From an answer to a similar question, specifying an 'activate' function in the jQuery will set the hiddenField value when the user selects a tab, which you could read from the postback:
$("#tabs").tabs({
activate: function() {
var selectedTab = $('#tabs').tabs('option', 'active');
$("#<%= hfLastTab.ClientID %>").val(selectedTab);
},
active: <%= hfLastTab.Value %>
});