开发者

Asp.net mvc route map problem

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜