Results 1 to 13 of 13

Thread: Weird...master page menu button events not firing on some pages only

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618

    Weird...master page menu button events not firing on some pages only

    This is a new error I wasn't having before not sure were it came from. I have a master page with a menu on it. I have found now two pages out of dozens where for some reason the master page events aren't firing. I've put a break point in there and it never hits it. Is there something that could cause a disconnect between the page and the master page events? Really weird it happens in Chrome and IE but they fire correctly in Safari.
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,715

    Re: Weird...master page menu button events not firing on some pages only

    Is this Visual Basic.Net code or ASP.Net code?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618

    Re: Weird...master page menu button events not firing on some pages only

    Quote Originally Posted by dday9 View Post
    Is this Visual Basic.Net code or ASP.Net code?
    Sorry yeah this should go in the ASP.NET forum if you could move it over for me thanks.
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,715

    Re: Weird...master page menu button events not firing on some pages only

    Moderator Action: Moved to ASP.Net
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618

    Re: Weird...master page menu button events not firing on some pages only

    Not sure if it helps, but when I click a button my URL changes slightly from:

    http://localhost:59516/ASC/Admin/Pro...?projectID=224

    to

    http://localhost:59516/ASC/Admin/Pro...projectID=224#

    with a number sign added.
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  6. #6
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,020

    Re: Weird...master page menu button events not firing on some pages only

    There are workarounds shown in these threads on treating #FragmentIdentifier (hashtag).

    removing-fragmentidentifier-from-url-on-postback
    how-to-get-url-hash-from-server-side

    KGC
    Last edited by KGComputers; Aug 5th, 2014 at 11:58 PM.
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618

    Re: Weird...master page menu button events not firing on some pages only

    Any other thoughts? The # sign is a result but doesn't explain what is causing the master page event not to fire. I put a break in the master page Page_Load event and that triggers on the page load so they are definitely linked. (Although it does not trigger when the button clicks aren't firing so their seems to be no post back at all).

    Also noticed the logout button doesn't work so basically no events on the master page are firing for some reason, but only on 2 out of 50 or so pages I have checked. Looking for thoughts on what could break it.
    Last edited by SeanGrebey; Aug 7th, 2014 at 01:28 PM.
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  8. #8
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,020

    Re: Weird...master page menu button events not firing on some pages only

    Quote Originally Posted by SeanGrebey View Post
    Any other thoughts? The # sign is a result but doesn't explain what is causing the master page event not to fire. I put a break in the master page Page_Load event and that triggers on the page load so they are definitely linked. (Although it does not trigger when the button clicks aren't firing so their seems to be no post back at all).

    Also noticed the logout button doesn't work so basically no events on the master page are firing for some reason, but only on 2 out of 50 or so pages I have checked. Looking for thoughts on what could break it.
    Did you integrate ajax update panels or jquery or javascript to your asp.net buttons in your .aspx markup/master page?
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618

    Re: Weird...master page menu button events not firing on some pages only

    Quote Originally Posted by KGComputers View Post
    Did you integrate ajax update panels or jquery or javascript to your asp.net buttons in your .aspx markup/master page?
    No the master page is very simple, just the Navigation Menu and a LoginStatus control. The only code behind is catching the navigation menu on click and redirecting to different pages based on the user's role.
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618

    Re: Weird...master page menu button events not firing on some pages only

    Code:
    <%@ Master Language="VB" AutoEventWireup="false" CodeFile="Site.Master.vb" Inherits="Site" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head runat="server">
        <title></title>
        <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    
        <style type="text/css">
            .dynamic li { z-index: 999999; }
        </style>
    
        <asp:ContentPlaceHolder ID="HeadContent" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form runat="server">
        <div class="page">
            <div class="header">
                <div class="title">
                <h1>
                    <asp:Label ID="lbPageTitle" runat="server" Text="Pronager Project Portfolio"></asp:Label>
                </h1>                
                </div>
                <div class="loginDisplay">
                    <asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
                        <AnonymousTemplate>
                            [ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
                        </AnonymousTemplate>
                        <LoggedInTemplate>
                            Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>!
                            [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/Account/Login.aspx"/> ]
                        </LoggedInTemplate>
                    </asp:LoginView>
                </div>
                <div class="clear hideSkiplink">
                    <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal" RenderingMode="List">
                        <Items>
                            <asp:MenuItem Text="Companies" Value="Companies"></asp:MenuItem>
                            <asp:MenuItem Text="Dashboard" Value="Dashboard" >
                                <asp:MenuItem Text="Projects" Value="Projects"></asp:MenuItem>
                                <asp:MenuItem Text="Services" Value="Services"></asp:MenuItem>
                            </asp:MenuItem>
                            <asp:MenuItem Text="Calendar" Value="Calendar"></asp:MenuItem>
                            <asp:MenuItem Text="New" Value="New">
                                <asp:MenuItem Text="New Project" Value="New Project"></asp:MenuItem>
                                <asp:MenuItem Text="New Service" Value="New Service"></asp:MenuItem>
                            </asp:MenuItem>
                            <asp:MenuItem Text="Timesheet" Value="Timesheet" />
                            <asp:MenuItem Text="Maintenance" Value="Maintenance">
                                <asp:MenuItem Text="Users" Value="Users"></asp:MenuItem>
                                <asp:MenuItem Text="Sub Contractors" Value="Sub Contractors"></asp:MenuItem>
                                <asp:MenuItem Text="Customers" Value="Customers"></asp:MenuItem>
                                <asp:MenuItem Text="Parts" Value="Parts"></asp:MenuItem>
                                <asp:MenuItem Text="Rates" Value="Rates"></asp:MenuItem>
                                <asp:MenuItem Text="Vendors" Value="Vendors"></asp:MenuItem>
                                <asp:MenuItem Text="Service Types" Value="Service Types"></asp:MenuItem>
                                <asp:MenuItem Text="Automation" Value="Automation"></asp:MenuItem>
                                <%--<asp:MenuItem Text="Welcome Text" Value="Welcome Text"></asp:MenuItem> --%>                           
                            </asp:MenuItem>
                            <asp:MenuItem Text="Documents" Value="ACS Docs">
                                <asp:MenuItem Text="Shared Documents" Value="Shared Documents"></asp:MenuItem>
                                <asp:MenuItem Text="Internal Documents" Value="Internal Documents"></asp:MenuItem>
                                <asp:MenuItem Text="Tutorials" Value="Tutorials"></asp:MenuItem>
                            </asp:MenuItem>
                            <asp:MenuItem Text="Change Password" Value="Change Password"></asp:MenuItem>
                            <asp:MenuItem Text="Documents" Value="Forms">
                                <asp:MenuItem Text="ADT Contracts" Value="ADT Contract"></asp:MenuItem>
                                <asp:MenuItem Text="Download Documents" Value="Download Documents"></asp:MenuItem>
                            </asp:MenuItem>
                            <asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
                            <asp:MenuItem Text="Feedback" Value="Feedback"></asp:MenuItem>
                        </Items>
                    </asp:Menu>
                </div>
            </div>
            <div class="main" style="z-index=1">
                <asp:ContentPlaceHolder ID="MainContent" runat="server"/>
            </div>
            <div class="clear">
            </div>
        </div>
        <div class="footer">
            
        </div>
        </form>
    </body>
    </html>
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  11. #11
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,020

    Re: Weird...master page menu button events not firing on some pages only

    As I reviewed your url in post# 5, the # character is added in the query string.
    Try encoding the url first.

    HttpServerUtility.UrlEncode()

    KGC
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  12. #12

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618

    Re: Weird...master page menu button events not firing on some pages only

    Quote Originally Posted by KGComputers View Post
    As I reviewed your url in post# 5, the # character is added in the query string.
    Try encoding the url first.

    HttpServerUtility.UrlEncode()

    KGC
    The issue is that the page is not posting back, so no events are firing. I'm not sure why the # sign is appearing but it never reaches code behind at all so encoding won't help.
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  13. #13
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,020

    Re: Weird...master page menu button events not firing on some pages only

    but it never reaches code behind at all so encoding won't help.
    So, I believe you have to remove manually the # sign through client side/javascript when a link is
    clicked.
    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width