How do i get Client Id of usercontrol which is inside a tabconatiner?
I have a tabcontainer which contains tabpanel which in turn contains a usercontrol. If i try to get usercontrols id using
<cc1:TabContainer ID="tabContainer" runat="server" ActiveTabIndex="0" Width="100%"
开发者_运维知识库 OnClientActiveTabChanged="tabChanged" onChange="tabChanged">
<cc1:TabPanel ID="tabGeneral" runat="server" HeaderText="General">
<HeaderTemplate>
General
</HeaderTemplate>
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanelGeneralTab" runat="server">
<ContentTemplate>
<POGen:POProcessingGeneral ID="POProcessingGeneral1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</cc1:TabPanel>
This statement returns 0
alert($('#<%=tabGeneral.ClientID %> #<%=POProcessingGeneral1.ClientID%>').length);
How do i get clientid of usercontrol?
You should be able to do #<%=POProcessingGeneral1.ClientID%> by itself. The INamingContainer interface on the TabContainer and TabPanel should automatically add the full client ID for your user control.
I'm assuming that both TabContainer and TabPanel are implementing INamingContainer as it should.
精彩评论