[英]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.