Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 12, 2012 11:41 AM by Sage Gu - MSFT
Member
144 Points
161 Posts
Jun 05, 2012 12:55 PM|LINK
Hi All,
<ajax:TabContainer runat="server" ID="test">
<ajax:TabPanel runat="server">
<HeaderTemplate>
<a href="#"><b>
test(i)</b></a>
</HeaderTemplate>
<ContentTemplate>
<asp:ContentPlaceHolder ID="hello" runat="server">
</asp:ContentPlaceHolder>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
in the above code i want add the bold lettered one from the code behind how to do that?
thanks,
All-Star
15346 Points
3142 Posts
Jun 05, 2012 12:58 PM|LINK
add an id to the TabPanel and using that ID say tabPanelID.HeaderTemplate.Controls.Add(new HyperLink())
Jun 05, 2012 06:32 PM|LINK
these is no control property to the headertemplate, hence the above one does not work.
Contributor
6693 Points
578 Posts
Microsoft
Jun 12, 2012 11:41 AM|LINK
Hi burepallisri,
You can add a Literal control in the Header Template. And set it from the code behind.
<HeaderTemplate> <a href="#"> <b> test(i) </b> </a> <asp:Literal ID="Literal1" runat="server"></asp:Literal> </HeaderTemplate>
code behind
protected void Page_Load(object sender, EventArgs e) { Literal lit = (Literal)test.FindControl("TabPanel1").FindControl("Literal1"); lit.Text = "<b>Your bold font</b>"; }
Regards,
Sage Gu - MSFT
burepallisri
Member
144 Points
161 Posts
how to add anchor tag to the header tamplate in the ajax tabpanel of tabcontainer from the code b...
Jun 05, 2012 12:55 PM|LINK
Hi All,
<ajax:TabContainer runat="server" ID="test">
<ajax:TabPanel runat="server">
<HeaderTemplate>
<a href="#"><b>
test(i)</b></a>
</HeaderTemplate>
<ContentTemplate>
<asp:ContentPlaceHolder ID="hello" runat="server">
</asp:ContentPlaceHolder>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
in the above code i want add the bold lettered one from the code behind how to do that?
thanks,
Mudasir.Khan
All-Star
15346 Points
3142 Posts
Re: how to add anchor tag to the header tamplate in the ajax tabpanel of tabcontainer from the co...
Jun 05, 2012 12:58 PM|LINK
add an id to the TabPanel and using that ID say tabPanelID.HeaderTemplate.Controls.Add(new HyperLink())
burepallisri
Member
144 Points
161 Posts
Re: how to add anchor tag to the header tamplate in the ajax tabpanel of tabcontainer from the co...
Jun 05, 2012 06:32 PM|LINK
these is no control property to the headertemplate, hence the above one does not work.
Sage Gu - MS...
Contributor
6693 Points
578 Posts
Microsoft
Re: how to add anchor tag to the header tamplate in the ajax tabpanel of tabcontainer from the co...
Jun 12, 2012 11:41 AM|LINK
Hi burepallisri,
You can add a Literal control in the Header Template. And set it from the code behind.
<HeaderTemplate> <a href="#"> <b> test(i) </b> </a> <asp:Literal ID="Literal1" runat="server"></asp:Literal> </HeaderTemplate>code behind
protected void Page_Load(object sender, EventArgs e) { Literal lit = (Literal)test.FindControl("TabPanel1").FindControl("Literal1"); lit.Text = "<b>Your bold font</b>"; }Regards,
Sage Gu - MSFT
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework