I've a page that has a nested Master pages. The control that is firing twice is on the Master Master Page (BasicContentMaster), as well the jquery click event function. How do i prevent firing the click event for the control twice?
The page that inherits two master page (inherits LandingPageMaster first),
<%@ Page Title="" Language="vb" AutoEventWireup="false"
MasterPageFile="~/landingpages/LandingPageMaster.master" CodeBehind="Components.aspx.vb" Inherits="WebsiteProject.Components" %>
Then LandingPageMaster inherits BasicContentMaster page
<%@ Master Language="VB" MasterPageFile="~/BasicContent.Master" AutoEventWireup="false" CodeBehind="LandingPageMaster.master.vb" Inherits="WebSiteProject.LandingPageMaster" %>
Here in BasicContentMaster is where the control that is firing twice when clicked from Component page,
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="BasicContent.master.vb" Inherits="WebSiteProject.BasicContent" %>
<img id="m-navigation-img" src="/images/nav_menu.png" />
jquery click function
$('#m-navigation-img').click(function () {
$('#m-navigation').slideToggle();
});
Try this:
$('#m-navigation-img').unbind('click').bind('click', function () {
$('#m-navigation').slideToggle();
});