Net子回发后不显示

Net子回发后不显示

本文介绍了ASP.Net子回发后不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用母版页ASP.Net菜单控制。我使用更新面板包裹日程地址搜索Maincontent。当回发发生,在母版页子菜单中不显示鼠标时结束。我需要再次点击则菜单将鼠标悬停在菜单的子菜单才会显示。

I has use ASP.Net menu control in master page. And I wrap the Maincontent using update panel. When postback is happen, the sub menu in master page not showing when mouse over. I need click again the menu then mouseover the menu the sub menu only show.

主页        

        <div class="float-right">
            <nav>
                <asp:Menu ID="mne" runat="server" Orientation="Horizontal" Font-Names="Arial, Verdana, Tahoma"
                    OnMenuItemClick="mne_MenuItemClick"  StaticEnableDefaultPopOutImage="false" Width="510px"
                    DynamicHorizontalOffset="20" StaticSubMenuIndent="250px" TabIndex="1" >
                    <LevelMenuItemStyles>
                        <asp:MenuItemStyle CssClass="level1" HorizontalPadding="10px" />
                    </LevelMenuItemStyles>
                    <StaticMenuStyle  />
                    <DynamicMenuStyle  />
                    <StaticHoverStyle BackColor="Wheat" />
                    <DynamicHoverStyle BackColor="Gray" ForeColor="White" />
                    <Items>
                        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"
                           Value="Home"></asp:MenuItem>
                        <asp:MenuItem Text="Management" Value="Management"
                           ToolTip="Management">
                            <asp:MenuItem Text="Edit" Value="Edit" ToolTip="Edit
                                NavigateUrl="~/Edit.aspx">
                            </asp:MenuItem>
                        </asp:MenuItem>
                        <asp:MenuItem Text="Logout" Value="Logout"></asp:MenuItem>
                    </Items>
                </asp:Menu>
            </nav>
        </div>
    </div>
</header>

Edit.aspx

Edit.aspx

<asp:DropDownList ID="Country" runat="server" AutoPostBack="true" OnSelectedIndexChanged="Country_SelectedIndexChanged">
                    </asp:DropDownList>

在下拉列表回传后,鼠标悬停在菜单中,不显示子菜单。我需要点击菜单,然后将鼠标悬停在子菜单就会显示出来。结果
什么是错呢?请帮助

After the drop down list postback, mouseover the menu, the submenu not showing. I need click on the menu then mouseover the submenu will display.
Anything is go wrong? Please help

推荐答案

根或父菜单中禁用回送:

Disable postback of root or parent menu:

MenuItem mnu = new MenuItem();
// if mnu has sub item(s)
mnu.Selectable = false;

当应用程序通过移动设备打开此选项是比较有用的。

this option is more useful when application opened by a mobile device.

这篇关于ASP.Net子回发后不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 13:43