简体   繁体   English

部分回发后,asp菜单不起作用

[英]asp menu not working after partial postback

I have a asp:menu that stops functioning after I perform a search on my page. 我在页面上执行搜索后,asp:菜单停止运行。 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 这是Button Click事件

  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();

        }
    }

我的解决方案是不使用VS 2012中的拖放菜单。我将其替换为编写的Jquery菜单,此后没有任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM