开发者

Asp.net mvc route map problem

开发者 https://www.devze.com 2022-12-28 07:00 出处:网络
I have created a new control VidController public class VidController : Controller { public ActionResult GetVids()

I have created a new control VidController

public class VidController : Controller

{

public ActionResult GetVids()

{

return View();

}

}

Right clicked inside the method and created View with default name GetVids. Now when i try to o开发者_开发百科pen ~/Vid/GetVids there is no page opening...

What i have to set in Global file?


Instead of opening ~/VidController/GetVids in your browser you could try /Vid/GetVids. In ASP.NET MVC the standard convention is that the Controller suffix is used for the class name but removed when resolving the route.

When you call VidController/GetVids, the routing engine is trying to find a controller named VidControllerController which obviously doesn't exist.

0

精彩评论

暂无评论...
验证码 换一张
取 消