簡體   English   中英

使用Asp.net中的查詢字符串打開Ajax TabContainer選項卡

[英]Open Ajax TabContainer tabs using query string in Asp.net

是否可以使用query string打開Ajax Tab Container

當查詢字符串是

localhost:81/dashboard.aspx?tab=0
localhost:81/dashboard.aspx?tab=1
localhost:81/dashboard.aspx?tab=3

我的代碼是

<ajax:TabContainer ID="TabContainer2" runat="server" CssClass="MyTabStyle">
                            <ajax:TabPanel ID="TabPanel2" runat="server" TabIndex="0">
                                <headertemplate>
                                   Overview
                                  </headertemplate>
                                <contenttemplate>                         
                             </contenttemplate>
                            </ajax:TabPanel>
                            <ajax:TabPanel ID="tbpnluser1" runat="server" TabIndex="1">
                                <headertemplate>
                                   Overview
                                </headertemplate>
                                <contenttemplate>                        
                           </contenttemplate>
                            </ajax:TabPanel>
                        </ajax:TabContainer>

請幫忙

是的,有一個稱為ActiveTabIndex的屬性

通過使用它,您可以在服務器端顯示所需的選項卡

在服務器端

 protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
       if(Request.QuerryString["tab"]==1)
              {

                tabcantainerID.ActiveTabIndex =1
             }
    .....
                 }
              }

希望這個能對您有所幫助

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM