局部回传后的asp菜单不工作 [英] asp menu not working after partial postback

查看:78
本文介绍了局部回传后的asp菜单不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP:菜单我执行我的网页上搜索后停止运行。搜索使用更新面板,并通过一个提交按钮触发。一旦结果显示在页面上的菜单悬停效果停止工作。它将不再向下展开的鼠标悬停。可点击链接仍然有效。

菜单是在网站的母版页,是搜索控件的更新面板外。

感谢您的帮助!

这是菜单

 < ASP:菜单ID =Menu5=服务器
                                        DynamicEnableDefaultPopOutImage =假
                                         方向=横向
                                         的renderingMode =列表
                                         StaticEnableDefaultPopOutImage =假
                                         StaticPopOutImageUrl =〜/图片/ DownArrow.png
                                         可见=假字体粗体=FALSE前景色=黑>                                        <项目>
                                            < ASP:菜单项PopOutImageUrl =〜/图片/ bullet.png可选=FALSE文本=添加>
                                                < ASP:菜单项文本=项目NavigateUrl =〜/行政/ CreateItem.aspx>< / ASP:菜单项>
                                                < ASP:菜单项文本=联系NavigateUrl =〜/行政/ CreateContact.aspx>< / ASP:菜单项>
                                            < / ASP:菜单项>
                                            < ASP:菜单项文本=更新可选=FALSE值=更新>
                                                < ASP:菜单项文本=项目NavigateUrl =〜/行政/ UpdateItem.aspxVALUE =项目>< / ASP:菜单项>
                                                < ASP:菜单项文本=联系NavigateUrl =〜/行政/ UpdateContact.aspxVALUE =联系>< / ASP:菜单项>
                                            < / ASP:菜单项>
                                            < ASP:菜单项文本=批准可选=FALSE值=批准>
                                                < ASP:菜单项文本=项目NavigateUrl =〜/行政/ ApproveItem.aspxVALUE =项目>< / ASP:菜单项>
                                                < ASP:菜单项文本=联系NavigateUrl =〜/行政/ ApproveContact.aspxVALUE =联系>< / ASP:菜单项>
                                            < / ASP:菜单项>
                                        < /项目>
                                         < StaticMenuItemStyle Horizo​​ntalPadding =10px的/>
                                    < / ASP:菜单>

这是按钮点击事件

 保护无效btnSubmit_Click(对象发件人,EventArgs的发送)
    {
        如果(Page.IsValid)
        {
            字符串关键字= txtSearch.Text.Trim();
             清单<动态>结果= SearchItems(关键字);
             清单<动态> Cresults = SearchContacts(关键字);
            //绑定和返回
            lv.DataSource =结果;
            lv.DataBind();
            //联系方式回报绑定
            LVC.DataSource = Cresults;
            LVC.DataBind();        }
    }


解决方案

我的解决方法是不使用从2012年VS拖放菜单我一个jQuery菜单即写道,此后便没有问题,更换这一点。

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

        }
    }

解决方案

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.

这篇关于局部回传后的asp菜单不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆