Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
I have just started the mvc 3 with razor engine, added 1st view as addcountry, it's controller,
Controller code is here, but debug is not coming at this index, where was i mistaken, should i change the route ?

public ActionResult Index()
{
return View();
}


CSS
the image of resource not found is here,
http://tinypic.com/view.php?pic=2zqy7oh&s=8

if i write path as

http://localhost:44674/AddCountry/Index

then it opens the page,but i want to open the page without any manually writing of path.

I added view after controller & by right click below code & then click on add view


public ActionResult Index()
{
return View();
}


My route
is
C#
public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

          routes.MapRoute(
              "", // Route name
              "{controller}/{action}/{id}", // URL with parameters
              new { controller = "AddCountry", action = "Index", id = UrlParameter.Optional } // Parameter defaults
          );
  //        routes.MapRoute(
  //            "Home", // Route name
  //            "{controller}/{action}/{id}", // URL with parameters
  //            new
  //            {
  //                controller = "AddCountry",
  //                action = "Index",
  //                id = UrlParameter.Optional
  //            } // Parameter defaults
  //);

      }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900