I want to perform some check after OnClientClick event of Tab Panel in a Javascript function. If my conditions return true I want to allow tab change otherwise want to restrict user on same tab without posting back. PFB code block.
Any help will be great...
<cc1:TabContainer ID="tabContainer" runat="server" AutoPostBack="false"
BackColor="Red" CssClass="ajax__tab_yuitabview-theme">
<cc1:TabPanel runat="server" HeaderText="A" ID="tbPrograms" OnClientClick="ClickMe;return false">
<ContentTemplate>
Tab1
</ContentTemplate>
</cc1:TabPanel>
Tab2
<ContentTemplate>
<uc2:EmployerResources ID="B" runat="server" />
</ContentTemplate>
</cc1:TabPanel>
Tab3
<ContentTemplate>
<uc3:ExternalResou开发者_运维百科rces ID="C" runat="server" />
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
Give only the name of the javascript function like tabPanel1.OnClientClick="MyJavascriptFunction" and not like this tabPanel1.OnClientClick="MyJavascriptFunction()"
Did you try:
onclientactivetabchanged="ClickMe;return false"
add clickme function in attributes of tab panel
at the loading of page
like
tbPrograms.Attributes.Add("onClick","ClickMe(); return false;");
I hope this will work
精彩评论