怎么获取TabContainer的HeaderText值啊...

来源:百度知道 编辑:UC知道 时间:2024/06/24 08:35:24
protected void TabContainer1_ActiveTabChanged(object sender, EventArgs e)
{
string a= TabContainer1.ActiveTabIndex.ToString();
Label1.Text = TabContainer1.ActiveTabIndex.ToString();
SqlDataSource1.SelectCommand = "select * from cs where kaitou='" + a + "'";
}

这段代码有错误吗?

为什么Label1.Text没有值呢..
一楼的...能说的清楚点吗...

我用的是VS2008 C#..

里面没有TabPanel 属性...

由多个部分组成的:一个是TabContainer,一个是TabPanel
HeaderText 是TabPanel 的属性

补充:
这个控件和Accordion控件很像。它也是没有目标控件的独立控件,它也由多个部分组成的:一个是TabContainer,一个是TabPanel。关系如同Accordion和AccordionPane的关系。我们先来看属性。
它由两个部分构成,所以两部分分别拥有自己的属性:

TabContainer Properties

ActiveTabChanged (Event) - Fired on the server side when a tab is changed after a postback【当tab变化发生回传后触发的服务器端事件】
OnClientActiveTabChanged - The name of a javascript function to attach to the client-side tabChanged event【任何tab变化时触发的客户端脚本函数】
CssClass - A css class override used to define a custom look and feel for the tabs【样式表】
ActiveTabIndex - The first tab to show【默认展开的tab索引】
Height - sets the height of the body of the tabs (does not include the TabPanel headers)【高】
Width - sets the width of the body of the tabs【宽】
ScrollBars - Whether to display scrollbars (None, Horizontal, Vertical, Both, Auto) in the body of the TabContainer【滚动条的展示方式】
TabPanel Properties