Home  >  Article  >  Backend Development  >  asp.net uses .net controls to create drop-down navigation menus

asp.net uses .net controls to create drop-down navigation menus

巴扎黑
巴扎黑Original
2018-05-26 11:21:563692browse

asp.net uses .net controls to create drop-down navigation menus

Today’s small test is that the teacher asked us to use .NET controls to create a pull-down menu. The requirements are as follows:
Move the mouse to the parent menu to pop up 3 submenus. And each submenu has hyperlinks.

The following is the code I made myself:

<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" Width="100%" 
            Font-Size="14px" ForeColor="#161621" Font-Bold="True" 
            PathSeparator="1" StaticEnableDefaultPopOutImage="False" 
            > 
          
                <DynamicMenuStyle BackColor="#D0E6DE" /> 
          
                <DynamicMenuItemStyle ItemSpacing="5px" /> 
          
                <Items> 
                    <asp:MenuItem Text="IT从业之家" Value=" http://www.3ppt.com " NavigateUrl="~/Introduce.aspx?id=1"> 
                        <asp:MenuItem Text="IT从业" Value="IT从业" NavigateUrl="~/Introduce.aspx?id=1"></asp:MenuItem> 
                        <asp:MenuItem Text="IT从业" Value="NavigateUrl="~/Introduce.aspx?id=2"></asp:MenuItem> 
                        <asp:MenuItem Text="IT从业" Value="IT从业" NavigateUrl="~/PIntroduce.aspx?id=1"></asp:MenuItem> 
                        <asp:MenuItem Text="IT从业" Value="IT从业" NavigateUrl="~/PIntroduce.aspx?id=2"></asp:MenuItem> 
                    </asp:MenuItem> 
                    <asp:MenuItem Text="IT从业" ValueNavigateUrl="~/News.aspx"></asp:MenuItem> 
                    <asp:MenuItem Text="IT从业" Value="IT从业" NavigateUrl="~/Product.aspx?id=1"> 
                        <asp:MenuItem Text="IT从业" Value="IT从业" NavigateUrl="~/Product.aspx?id=0"></asp:MenuItem> 
                        <asp:MenuItem Text="IT从业" Value="IT从业" NavigateUrl="~/Product.aspx?id=1"></asp:MenuItem> 
                    </asp:MenuItem> 
                    <asp:MenuItem Text="IT从业" Value="IT从业" NavigateUrl="~/Message.aspx"></asp:MenuItem> 
                    <asp:MenuItem Text="IT从业" Value="IT从业" NavigateUrl="~/Download.aspx"></asp:MenuItem> 
                    <asp:MenuItem Text="在线联系 " Value="在线联系" NavigateUrl="~/Content.aspx"></asp:MenuItem> 
                </Items> 
            </asp:Menu>

ASP.NET uses .net controls to realize the production of drop-down navigation menu

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn