I want to have a drop down navigation menu in ASP.NET MVC 3, Are there any tutorials?? I realy cant find anything. I am working with visual studio 2010 with the Razor engine.
I have this for the _Layout.cshtml:
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 3.0 License
Name : Reinstated
Description: A two-column, fixed-width design with dark color scheme.
Version : 1.0
Released : 20120326
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<title>@ViewBag.Title</title>
<link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/WinituLayout/style.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Content/WinituLayout/init.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/WinituLayout/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/WinituLayout/jquery.dropotron-1.0.js")" type="text/javascript"></script>
I think that you need a last parameter of 'null' on your <li>@Html.DropDownList( "PriorityID", new List<SelectListItem>(), new (@class="first"), null )</li>.
SavantKing10
Member
3 Points
19 Posts
Multilevel Menus in asp.net mvc3
Apr 04, 2012 07:52 AM|LINK
Hi Everyone,
I want to have a drop down navigation menu in ASP.NET MVC 3, Are there any tutorials?? I realy cant find anything. I am working with visual studio 2010 with the Razor engine.
I have this for the _Layout.cshtml:
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 3.0 License
Name : Reinstated
Description: A two-column, fixed-width design with dark color scheme.
Version : 1.0
Released : 20120326
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<title>@ViewBag.Title</title>
<link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/WinituLayout/style.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Content/WinituLayout/init.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/WinituLayout/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Content/WinituLayout/jquery.dropotron-1.0.js")" type="text/javascript"></script>
</head>
<body>
<div id="wrapper">
<div id="splash">
<img src= "Content/WinituLayout/images/pic1.jpg" alt="" />
</div>
<div id="menu">
<ul>
<li>@Html.ActionLink("Home", "Index", "Home")</li>
<li>@Html.ActionLink("Beheer", "Index", "Home")</li>
<li>@Html.ActionLink("Uren", "Index", "Home")</li>
<ul>
<li> @Html.ActionLink("Home", "Index",new{id=1}, new{@class = "first"})</li>
<li><a href="#">Libero felis dolor</a></li>
<li>@Html.DropDownList("PriorityID", new List<SelectListItem>(), new {@class="first"} )</li>
<li></li>
</ul>
</ul>
</div>
<div id="header">
<div id="logo">
<h1><a href="#">Winitu uren beheer systeem</a></h1>
</div>
<div id="search">
<form action="" method="post">
<div>
<input class="form-text" name="search" size="32" maxlength="64" />
</div>
</form>
</div>
</div>
<div id="page">
<div id="content">
@RenderBody()
</div>
<div id="sidebar">
</div>
<br class="clearfix" />
</div>
</div>
<div id="footer">
© Klipperaak 2d |2411 ND Bodegraven</a>.
</div>
</body>
</html>
[/code]
I want to have under uren 2 more sub links, like this:
[code]
<ul>
<li> @Html.ActionLink("Home", "Index",new{id=1}, new{@class = "first"})</li>
<li><a href="#">Libero felis dolor</a></li>
<li>@Html.DropDownList("PriorityID", new List<SelectListItem>(), new {@class="first"} )</li>
<li></li>
</ul>
[/code]
The CSS class name is first: .dropotron li.first {
border-top: 0;
But how to call that class in MVC??
THX for helping
eric2820
Contributor
2777 Points
1161 Posts
Re: Multilevel Menus in asp.net mvc3
Apr 04, 2012 10:07 AM|LINK
I think that you need a last parameter of 'null' on your <li>@Html.DropDownList( "PriorityID", new List<SelectListItem>(), new (@class="first"), null )</li>.
http://www.my-msi.net/Admin
blog
If a post helps you, please mark it as Ansered, thank-you.