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:ExternalResources ID="C" runat="server" />
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
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:ExternalResources ID="C" runat="server" />
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
Share
edited Sep 29, 2011 at 8:23
Chat
asked Sep 29, 2011 at 6:57
ChatChat
692 gold badges3 silver badges12 bronze badges
2
- What platform is this? I don't see any JavaScript at all... – beatgammit Commented Sep 29, 2011 at 8:13
- @tjameson: I have seperate javascript function. I thought their is no need to put that funcation as well here. It has got some logic which will either return True or False at end. It is on windows platform. ASp.Net – Chat Commented Sep 29, 2011 at 8:23
3 Answers
Reset to default 2Give 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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744809538a4594981.html
评论列表(0条)