我有一个 DashBoardController.cs 这里我有这个代码
public class DashBoardController : Controller
{
//
// GET: /DashBoard/
[Authorize]
public ActionResult Index()
{
return View();
}
//
// GET: /New Project/
[Authorize]
public ActionResult NewProject()
{
return View();
}
//
// GET: /File Upload/
public ActionResult UploadFile()
{
return View();
}
[HttpPost]
public ActionResult UploadFile(HttpPostedFileBase file)
{
// Verify that the user selected a file
if (file != null && file.ContentLength > 0)
{
// extract only the fielname
var fileName = Path.GetFileName(file.FileName);
// store the file inside ~/App_Data/uploads folder
var path = Path.Combine(Server.MapPath("~/Uploads"), fileName);
file.SaveAs(path);
}
// redirect back to the index action to show the form once again
return RedirectToAction("Index", "Home");
}
}
我这里有另一个 masterlayout 文件我有这个代码
<div id="LeftColumn" class="ui_style_floatLeft">
<div id="menuWrapper">
<ul class="menu">
<li class="menuDashBoard">@Html.ActionLink("Dashboard","Index")</li>
<li class="menuProject"><a href="#">Project</a>
<ul>
<li>@Html.ActionLink("New Project","NewProject")</li>
<li><a href="#">Projects</a></li>
</ul>
</li>
<li class="menuAccount"><a href="#">Account</a>
<ul>
<li>@Html.ActionLink("Change Password", "ChangePassword", "Account")</li>
</ul>
</li>
</ul>
</div>
</div>
但是,如果我转到Change Password
操作链接,则其他链接 ( New Project
, Dashboard
) 不起作用。我尝试@Url.Action
使用 herf attr 但不工作:(
我现在该怎么办 ?