Frage

I wanted to set up an MVC 2 web application in Visual Studio 2010 using C# as the language. For that, I referred the link: http://msdn.microsoft.com/en-us/library/dd410597.aspx and I created the same. When I ran the application by pressing F5, I got an error in my browser. I have attached the error information below. Server Error

Please help me to resolve this.

War es hilfreich?

Lösung

MVC is different from regular ASP.NET. In MVC you are using the http-address to tell your application which method to fire in which class.

In MVC language methods are called "Actions". And classes are called "Controllers" (ruffly speaking). If you want the first view to show, you will have to tell the class "HomeController" to perform its method "Index()".
You do this by entering the address: "localhost/Home/Index"

Please read more here: http://msdn.microsoft.com/en-us/library/dd410269(VS.98).aspx

Andere Tipps

If your controller is called MapsController with an ViewMaps action as shown in the tutorial then you should navigate to /maps/viewmaps in your browser to execute this action.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top