asp menu not working after partial postback

自闭症网瘾萝莉.ら 提交于 2020-01-16 09:02:13

问题


I have a asp:menu that stops functioning after I perform a search on my page. The search uses a update panel and is triggered by a submit button. Once the results are displayed on the page the menu hover effects stop working. It will no longer expand down on mouseover. The clickable links still work.

The menu is in the site's master page and is outside the update panel of the search control.

Thank you for any help!

This is the menu

  <asp:Menu ID="Menu5" runat="server" 
                                        DynamicEnableDefaultPopOutImage="False"
                                         Orientation="Horizontal"
                                         RenderingMode="List"
                                         StaticEnableDefaultPopOutImage="False"
                                         StaticPopOutImageUrl="~/Images/DownArrow.png"
                                         Visible="False" Font-Bold="False" ForeColor="Black">

                                        <Items>
                                            <asp:MenuItem PopOutImageUrl="~/Images/bullet.png" Selectable="False" Text="Add" >
                                                <asp:MenuItem Text="Item" NavigateUrl="~/Admin/CreateItem.aspx" ></asp:MenuItem>
                                                <asp:MenuItem Text="Contact" NavigateUrl="~/Admin/CreateContact.aspx" ></asp:MenuItem>
                                            </asp:MenuItem>
                                            <asp:MenuItem Text="Update" Selectable="False" Value="Update">
                                                <asp:MenuItem Text="Item" NavigateUrl="~/Admin/UpdateItem.aspx" Value="Item"></asp:MenuItem>
                                                <asp:MenuItem Text="Contact" NavigateUrl="~/Admin/UpdateContact.aspx" Value="Contact"></asp:MenuItem>
                                            </asp:MenuItem>
                                            <asp:MenuItem Text="Approve" Selectable="False"  Value="Approve" >
                                                <asp:MenuItem Text="Item" NavigateUrl="~/Admin/ApproveItem.aspx" Value="Item"></asp:MenuItem>
                                                <asp:MenuItem Text="Contact" NavigateUrl="~/Admin/ApproveContact.aspx" Value="Contact"></asp:MenuItem>
                                            </asp:MenuItem>
                                        </Items>
                                         <StaticMenuItemStyle HorizontalPadding="10px" />
                                    </asp:Menu>

This is the Button Click event

  protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {


            string keyword = txtSearch.Text.Trim();
             List<dynamic> results = SearchItems(keyword);
             List<dynamic> Cresults = SearchContacts(keyword);




            //bind and return
            lv.DataSource = results;
            lv.DataBind();


            //Contact Bind return
            LVC.DataSource = Cresults;
            LVC.DataBind();

        }
    }

回答1:


My solution is not to use the drag and drop menus from VS 2012. I replaced this with a Jquery Menu that wrote and have had no issues since.



来源:https://stackoverflow.com/questions/13686871/asp-menu-not-working-after-partial-postback

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!