Home ASP.Net Menu Not Working In Edge
Reply: 0

ASP.Net Menu Not Working In Edge

starx207
1#
starx207 Published in 2018-01-09 16:34:19Z

My company has a website written in ASP.Net 4. On the site master page there is a navigation menu with the following markup:

<asp:Menu ID="Menu1" runat="server" 
            CssClass="menu" EnableViewState="False" 
                                    IncludeStyleBlock="False" 
                                    onmenuitemclick="Menu1_MenuItemClick" 
            BackColor="#ECFFF5" Font-Size="Larger" >
            <DynamicSelectedStyle ForeColor="#0000FF" />
            <StaticSelectedStyle Font-Underline="true" />
                <Items>
                    <asp:MenuItem Text="General Information" Value="~/Default.aspx"></asp:MenuItem>
                    <asp:MenuItem Value="~/LandDetail.aspx" Text="Land Detail"/>
                    <asp:MenuItem Text="Buildings Detail" Value="~/Buildings.aspx"></asp:MenuItem>
                    <asp:MenuItem Text="Value History" Value="~/ValueHistory.aspx"></asp:MenuItem>
                    <asp:MenuItem Text="Sales History" Value="~/SalesHistory.aspx"></asp:MenuItem>
                </Items>
</asp:Menu>

The function Menu1_MenuItemClick redirects to the appropriate page based on the value (some menu items link to external pages, but I haven't included the complete markup).

This works in every browser I've tested on except Edge. After replacing the contents of Menu1_MenuItemClick with Response.Write("<script>console.log('In click event')</script>"), I checked the log output on all my test browsers. Each one would log the message except Edge, which leads me to believe that for some reason, the click event is not firing in Edge.

Seems like this is a bug in Edge. Has anyone else encountered this? If so, were you able to fix it?

Edit Here is the html and javascript generated in Edge. I believe this is all the relevant portions, but if there's anything else I should include, let me know.

HTML:

<a href="#Menu1_SkipLink">
  <img alt="Skip Navigation Links" src="/WebResource.axd?d=3zekzOm7wdY2v6Fqj9tMppVjePvTb6jHiJpivJ5DBS4_4BhMD9MhlesmVZZYvoXaQDeTYipLC7c2b27tAT6ZyWbpl5iXmJF3JNrd6yUyViI1&amp;t=636125516399126630" width="0" height="0" style="border-width:0px;" />
</a>
<div class="menu" id="Menu1">
  <ul class="level1">
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;~/Default.aspx&#39;)">General Information</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;~/LandDetail.aspx&#39;)">Land Detail</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;~/Buildings.aspx&#39;)">Buildings Detail</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;~/ValueHistory.aspx&#39;)">Value History</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;~/SalesHistory.aspx&#39;)">Sales History</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;~/TaxChargesPayments2.aspx&#39;)">Tax Charges and Payments</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;TaxRates&#39;)">Current Tax Rates</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;~/WhereTaxesGo.aspx&#39;)">Where Your Taxes Go</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;~/TaxEstimator.aspx&#39;)">Tax Estimator</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;Map&#39;)">Map</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;~/Sketch.aspx&#39;)">Sketch</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;PRC&#39;)">Property Record Card</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;Photo&#39;)">Photo Gallery</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;Recorder&#39;)">Deed Record</a></li>
    <li><a class="level1" href="#" onclick="__doPostBack(&#39;ctl00$Menu1&#39;,&#39;NewSearch&#39;)">New Search</a></li>
  </ul>
</div>

Javascript:

function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.345433 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO