一,控制器
![](/upload/ad_content/xuanchuantu-17.jpg)
成都创新互联是一家集网站建设,田阳企业网站建设,田阳品牌网站建设,网站定制,田阳网站建设报价,网络营销,网络优化,
田阳网站推广为一体的创新建站企业,帮助传统企业提升企业形象加强企业竞争力。可充分满足这一群体相比中小企业更为丰富、高端、多元的互联网需求。同时我们时刻保持专业、时尚、前沿,时刻以成就客户成长自我,坚持不断学习、思考、沉淀、净化自己,让我们为更多的企业打造出实用型网站。
![](/upload/otherpic35/302231043533612.png)
CheckIndexAreaRegistration.cs
public class CheckIndexAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "CheckIndex";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"CheckIndex_default",
"CheckIndex/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional },
new string[] { typeof(CheckIndexAreaRegistration).Namespace } //增加此行,不然会出现controller命名重复的exception
);
}
}
ShowAllController.cs
public class ShowAllController : BaseController
{
[SkipRole]
public ActionResult Index()
{
return View();
}
}
二,视图
![](/upload/otherpic35/302232453998208.png)
分享文章:MVC视图与控制器分离简单描述-创新互联
浏览地址:
http://whjierui.cn/article/dcghhd.html