私はまだASP.NET MVCを初めて使い始めています。私はルーティングに少し苦労しています。ASP.NET MVCで、自分のウェブサイトを公開した後に404エラーが発生するのはなぜですか?
(Visual Studioから直接実行される)ASP.NET開発サーバーを使用すると、私のアプリケーションは問題なくビューを見つけることができます。標準のASP.NETのURLが使用されている - http://localhost:1871/InterestingLink/Register
私はIISとhttp://localhost/MyFancyApplication/InterestingLink /レジスタを介してアクセスをし、私のサイトを公開するときしかし、私は404エラーを取得します。
何が間違っているかに関するご意見はありますか?
詳細情報...
これは私のGlobal.asaxファイルは、(標準)のようになります。
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
);
}
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
}
}
私のコントローラはまた、非常に簡単です:の
public class InterestingLinkController : Controller
{
public ActionResult Register()
{
return View("Register");
}
}