wintersylf
wintersylf

Reputation: 177

@Html.Action - Error CS0103: The name does not exist in the current context

I guess the error is generic enough it pops up in a lot of contexts. specifically, I have a brand new MVC5 project that contains two views; the first wants to include the second via the @Html.Action method, which I used to do in MVC3.

the error is complaining about not finding the name (the parameter passed to the Action method), so obviously, it's not having an issue resolving the method, and the Home controller includes an action with that name (AboutUs), also the Views\Home directory contains an AboutUs.cshtml

so what could the problem be here?

Upvotes: 1

Views: 1590

Answers (1)

wintersylf
wintersylf

Reputation: 177

I figured out the problem; posting the answer here for anyone else who might encounter this.

the second view could not be compiled because it was making a reference to a resource that didn't exist, which coincidentally was named the same as the view itself.

the guys on irc.freenode.net/c# helped me figure this out by having me access the second view directly... upon that attempt, the full error message was displayed and I understood the problem.

hope this was useful to someone!

Upvotes: 2

Related Questions