[英]Link <a href=“…”/> is not working in nopcommerce in submenu
I am new to NopCommerce and I want to add submenu in my store. 我是NopCommerce的新手,我想在我的商店中添加子菜单。
I have added my submenu, but when I click on it, the link which I have given in is not working and it gives me an error. 我已经添加了子菜单,但是当我单击它时,输入的链接不起作用,这给我一个错误。
My code is as below: 我的代码如下:
Menu View File 菜单查看文件
<li id="DevelopmentItem">
<a href="">Development</a>
<ul id="Developmentsubmenu" class="dropdown-ul">
**<li><a href="~/Common/NpcDevelopment">NPC Development</a></li>
<li><a href="~/Indies/NPCExtensions">NPC Extension Development</a></li>
<li><a href="#">NPC Customize</a></li>**
</ul>
</li>
<script type="text/javascript">
$('#DevelopmentItem').live('mouseenter', function () {
$('#Developmentsubmenu').addClass('active');
});
$('#DevelopmentItem').live('mouseleave', function () {
$('#Developmentsubmenu').removeClass('active');
});
</script>
CommonController.cs file CommonController.cs文件
public ActionResult NpcDevelopment()
{
return View();
}
NpcDevelopment View File NpcDevelopment查看文件
@{
ViewBag.Title = "NpcDevelopment";
Layout = "~/Views/Shared/_ColumnsOne.cshtml";
}
<h2>NpcDevelopment</h2>
I can't find my fault. 我找不到我的错。 Can anyone help me?
谁能帮我?
Are you using mvc3 to develop? 您正在使用mvc3进行开发吗? If you are, replace
<a href="~/Common/NpcDevelopment"> with this
<a href="@Url.Action("{Action}", "{Controller}")">
for example: <a href="@Url.Action("NpcDevelopment", "Common")">
如果是这样,请将
<a href="~/Common/NpcDevelopment"> with this
替换<a href="~/Common/NpcDevelopment"> with this
<a href="@Url.Action("{Action}", "{Controller}")">
,例如: <a href="@Url.Action("NpcDevelopment", "Common")">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.