如何在页面顶部的布局页面中添加水平菜单? [英] How to add horizontal menu in layout page on top of page?

查看:76
本文介绍了如何在页面顶部的布局页面中添加水平菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网络应用程序中工作MVC asp.net visual studio 2015



如何制作如下水平菜单?



我需要将水平菜单添加到我的布局页面,如下所示:



 <  !DOCTYPE     html  >  
< html >
< head >
< meta charset = utf-8 / >
< meta name = viewport content = width = device-width,initial-scale = 1.0 >
< title > @ ViewBag.Title - 我的ASP.NET应用程序< / title >
@ Styles.Render(〜/ Content / css)
@ Scripts.Render(〜/ bundles / modernizr)

< / head >
< body >
< div class = navbar navbar-inverse navbar-fixed-top >
< div class = container >
< div class = navbar-header >
< 按钮 类型 = 按钮 class = navbar-toggle data-toggle = < span class =code-keyword> collapse data-target = .navbar-collapse >
< spa n class = icon-bar > < / span >
< span class = icon-bar > < / span >
< span = 图标栏 > < / span >
< / button >
@ Html.ActionLink(应用程序名称,索引,主页,新{area =},new {@class =navbar-brand})
< / div >
< div class = < span class =code-keyword> navbar-collapse collapse >
< u l class = nav navbar-nav >
< ; li > @ Html.ActionLink(Home,Index,主页)< / li >
< li > @ Html.ActionLink(关于,关于,主页)< / li >
< li > @ Html.ActionLink(联系方式,骗局机智,主页)< / li > ;
< / ul >
@ Html.Partial(_ LoginPartial)
< / div >
< / div >
< / div >
< div class = container body-content >
@RenderBody()
< hr / >
< 页脚 >
< p > ©@ DateTime.Now.Year - 我的ASP.NET应用程序< / p >
< /页脚 >
< / div >

@ Scripts.Render(〜/ bundles / jquery)
@ Scripts.Render(〜/ bundles / bootstrap)
@RenderSection(scripts,required:false)
< span class =code-keyword><
/ body >
< / html >





我需要在页面顶部添加水平菜单:



< a href =http://www.mediafire.com/view/5xaq2mj2nswyam5/top_menu.jpg>文件共享和存储变得简单 [ ^ ]



以便如何将水平菜单添加到顶部如上所述?



我的尝试:



如何在页面顶部的布局页面中添加水平菜单?

解决方案

由于您使用的是 bootstrap navbar [ ^ ],不应该是 bootstrap libraries [ ^ ] be放在它之前让它工作?


I work in web application MVC asp.net visual studio 2015

How to make horizontal menu as below ?

I need to add horizontal menu to my layout page as bellow :

<!DOCTYPE html>  
<html>  
<head>  
    <meta charset="utf-8" />  
    <meta name="viewport" content="width=device-width, initial-scale=1.0">  
    <title>@ViewBag.Title - My ASP.NET Application</title>  
    @Styles.Render("~/Content/css")  
    @Scripts.Render("~/bundles/modernizr")  
  
</head>  
<body>  
    <div class="navbar navbar-inverse navbar-fixed-top">  
        <div class="container">  
            <div class="navbar-header">  
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">  
                    <span class="icon-bar"></span>  
                    <span class="icon-bar"></span>  
                    <span class="icon-bar"></span>  
                </button>  
                @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })  
            </div>  
            <div class="navbar-collapse collapse">  
                <ul class="nav navbar-nav">  
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>  
                    <li>@Html.ActionLink("About", "About", "Home")</li>  
                    <li>@Html.ActionLink("Contact", "Contact", "Home")</li>  
                </ul>  
                @Html.Partial("_LoginPartial")  
            </div>  
        </div>  
    </div>  
    <div class="container body-content">  
        @RenderBody()  
        <hr />  
        <footer>  
            <p>© @DateTime.Now.Year - My ASP.NET Application</p>  
        </footer>  
    </div>  
  
    @Scripts.Render("~/bundles/jquery")  
    @Scripts.Render("~/bundles/bootstrap")  
    @RenderSection("scripts", required: false)  
</body>  
</html>



I need to add horizontal menu to top of page :

File sharing and storage made simple[^]

so that how to add horizontal menu to top of page as above ?

What I have tried:

How to add horizontal menu in layout page on top of page?

解决方案

Since you are using bootstrap navbar[^], shouldn't the bootstrap libraries[^] be placed before it for it to work?


这篇关于如何在页面顶部的布局页面中添加水平菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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