bq1*_*990 5 asp.net asp.net-mvc asp.net-mvc-routing
我正在使用MVC2 Preview 1开发一个非常简单的应用程序.
我有一个名为ContentController的控制器.我的问题是/ Content/Index工作正常,但/ Content /返回404.我在Studio Development Server上运行应用程序.
使用RouteDebugger测试但/ Content /返回404,并且不显示任何调试信息.
我没有更改路由代码:
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
Run Code Online (Sandbox Code Playgroud)
这是我的控制器:
public class ContentController : Controller
{
IRepository _repo = new SimpleRepository("db", SimpleRepositoryOptions.RunMigrations);
public ActionResult Index()
{
var content = _repo.GetPaged<Content>(0, 20);
return View(content);
}
Run Code Online (Sandbox Code Playgroud)
这是一个黑暗的镜头,但你有一个名为/ Content /的目录吗?
| 归档时间: |
|
| 查看次数: |
3238 次 |
| 最近记录: |