Problem with selecting tabs

Asked

Viewed 95 times

0

I have two tabs, one that shows my macros together and one to show the sent ones. The macros together are already selected by default and in the Page Load has the method that loads the corresponding data from it

When I click on the sent macros tab, my method is not even executed. How do I call a method inside li ?

What can it be?

<ul class="nav nav-tabs" role="tablist" id="myTab">
    <li class="active"><a href="#home" role="tab" data-toggle="tab">Macros juntas</a></li>
    <li><a href ="#enviadas" role="tab" data-toggle="tab" runat="server" onserverclick="Carregamacrosenviadas">Macros enviadas</a></li>      
</ul>
  • The plugin for tabs may be cancelling the method onserverclick. What the plugin what are you using for tabs? What code is present in the function Carregamacrosenviadas ?

1 answer

1

I believe only the attribute is missing data-toggle="tab" in the sent macros tab:

<li><a runat="server" href ="#enviadas" data-toggle="tab" onserverclick="Carregamacrosenviadas">Macros enviadas</a></li>
  • when I place the attribute 'data-toggle="tab"' my onserverclick event does not work, it does not call my method.

  • Can you run javascript in this function? If yes, just force the display of the correct tab, in this case, $('#myTab a[href="#enviadas"]').tab('show').

  • and if not? you would know? ^.^

  • Try using the attribute onclick: onclick="$(this).tab('show');"

  • Still I’m not getting, how tense !!!

  • How do I call a method I have on my page inside <li> ? I tried onserverclick, onclick and nothing !

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.