当我让每个提交都通过 response.redirect 时,我的 VB.net tabcontainer 需要保持在活动选项卡上。
我怎样才能做到这一点?我需要那个 response.redirect 因为它会显示在主选项卡容器中添加的内容。
<asp:TabContainer runat="server" ActiveTabIndex="0" Height="200px"
Width="175px" ScrollBars="Auto" EnableTheming="True" Font-
Underline="False" ID="TabContainer2" EnableViewState="False"
Style="float:right; padding-left: 110px; margin-bottom: 340px;"
OnActiveTabChanged="TabContainer1_ActiveTabChanged">
Protected Sub TabContainer1_ActiveTabChanged(ByVal sender As Object,
ByVal e As EventArgs)
ViewState("ActiveTabIdx") = TabContainer1.ActiveTabIndex
End Sub
Protected Sub SubmitCompanies_Click(ByVal sender As Object, ByVal e
As System.EventArgs) Handles SubmitCompanies.Click
*****there is more code here but for this question, it's not necessary so it has been
omitted*****
Response.Redirect(Request.RawUrl)
ViewState("ActiveTabIdx") = TabContainer1.ActiveTabIndex
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
ProductID.Value = Request.QueryString("id")
Page.Response.Cache.SetCacheability(HttpCacheability.NoCache)
If Not ViewState("ActiveTabIdx") Is Nothing Then
TabContainer1.ActiveTabIndex = Convert.ToInt32(Session("ActiveTabIdx"))
End If
End Sub