1

I know there are a lot other topics like this, but from what I found, and did accordingly to the answers - I still have the error.

The Global.asax:

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

The Controller:

public class FuncController : Controller { // // GET: /Func/ public ActionResult Main() { return View(); } public ActionResult Products() { return View(); } 

And accordingly the 2 .cshtml View files with the Main and Products names. In the "Project Properties->Web" I selected "Start URL" with value "http:// localhost:63497/Main". I don't get it where might the problem be, as in the other topics I found about this error, the problem was always in some of these things. But now, everything seems to be fine, and still - error.

0

2 Answers 2

2

Main is the Action method. You need to navigate to the Controller and let that hit the appropriate Action. Try navigating to:

http:// localhost:63497/Func/Main 

Which is Func Controller. ActionMethod Main

Sign up to request clarification or add additional context in comments.

1 Comment

You could change the Route by excluding the controller.
1

try like this..

 http://localhost:63497/Func/Main. 

because the route is from controller to ActionResult.

so, here Func is the Controller and the Main is your ActionResult Method.

so, you have to use the controller first in url before the Action Method.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.