0

I have a jQuery plugin that is use for tabbing menu like this code:

div id="tabsWithStyle" class="style-tabs">
        <ul>
             <li>
                <asp:LinkButton ID="Tozih"  OnClick="Tozih_Click" href="#facebook"  runat="server"><div class="icon picasa-icon">توضیح</div></asp:LinkButton>
            </li>
                <li>
                <asp:LinkButton ID="books" OnClick="books_Click"     runat="server"><div class="icon picasa-icon">کتاب</div></asp:LinkButton>
            </li>
              <li>
                <asp:LinkButton ID="jozve" OnClick="jozve_Click"  href="#facebook"  runat="server"><div class="icon picasa-icon">جزوه</div></asp:LinkButton>
            </li>
</ul>

and the jQuery is:

    <script type="text/javascript">
        $(function () {
            $('#tabsWithStyle').tabs();
        });
    </script>  

also #facebook is a div

   <div id="facebook">
countent
</div>

Edit : it's server-side event (C# code).

My problem is that onClick events don't work when I click on it

What's my problem ?

Edit 2 :

enter image description here

Edit 3:

protected void books_Click(object sender, EventArgs e)
{
    Response.Redirect("NewsFeed.aspx");
}
13
  • Is books_Click referring to server side event handler? Commented Apr 16, 2014 at 15:02
  • Use onclientclick to refer client side events! Commented Apr 16, 2014 at 15:03
  • and lastly $('#id_of_control').click(function() { }); will hook up client side event handling with jquery. Commented Apr 16, 2014 at 15:05
  • @brumScouse yes its a server side ( c# ) Commented Apr 16, 2014 at 15:13
  • can you also add the output HTML probably it is rendering some layout tabs plugin does like.. Commented Apr 16, 2014 at 15:13

3 Answers 3

1

Try this

$("#Tozih").on("click", function(event){
alert("clicked on Tozih"); 
});
Sign up to request clarification or add additional context in comments.

1 Comment

its a server side event
0

Since you are using serverside control you need to use client id:

$('#<%= Tozih.ClientID %>').on('click', function(){
  //your code, 'this' is a clicked element
});

Comments

0

Try this.

In your Linkbutton add one attribute causesvalidation

<asp:LinkButton ID="jozve" OnClick="jozve_Click" causesvalidation="false"  href="#facebook"  runat="server"><div class="icon picasa-icon">جزوه</div></asp:LinkButton>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.