asp.net - Calling Javascript on Client click event of Ajax tab panel - Stack Overflow

I want to perform some check after OnClientClick event of Tab Panel in a Javascript function. If my con

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
Add a ment  | 

3 Answers 3

Reset to default 2

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744809538a4594981.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信