<AjaxToolkit:tabpanel runat="server" id="nourl" headertext=" " width="90%" height="100px" visible="false" >
<headertemplate>
New
</headertemplate>
<contenttemplate >
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" valign="middle">
</td>
</tr>
</table>
</contenttemplate>
</AjaxToolkit:TabPanel>
</ajaxtoolkit:tabcontainer>
这是aspx
文件代码
在服务器端,我将此选项卡面板设置为可见真,然后我在另一个按钮事件中设置可见假,它不会隐藏选项卡面板。如何解决这个问题呢
try
{
DataTable dtFeedurls = getDatatable();
if (dtFeedurls.Rows.Count > 0)
{
foreach (DataRow dr in dtFeedurls.Rows)
{
AjaxControlToolkit.TabPanel tb = new AjaxControlToolkit.TabPanel();
tb.ID = ("Tab" + dr["COLUMN_1"].ToString());
tb.HeaderText = dr["COLUMN_2"].ToString();
tc.Tabs.Add(tb);
}
nourl.Visible = false;
}
else
{
nourl.Visible = true;
}
tc.ActiveTabIndex = 0;
}
catch (Exception ex)
{
throw ex;
}
这是服务器端代码