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");
}
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Mohammad Olfatmiri
  • 1,605
  • 5
  • 31
  • 57

3 Answers3

1

Try this

$("#Tozih").on("click", function(event){
alert("clicked on Tozih"); 
});
Dextere
  • 281
  • 1
  • 3
  • 13
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
});
cinek
  • 1,888
  • 2
  • 13
  • 14
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>
AB Vyas
  • 2,349
  • 6
  • 26
  • 43