I have created a mvc 3 web app.
_Layout.cshtml contain following menu
<li>@Html.ActionLink("Contact Us", "ContactUs", "Home")</li>
<li>@Html.ActionLink("Enquiry", "Enquiry", "Enquiry")</li>
For Enquiry I have created new folder Enquiry inside View folder and create Enquiry.cshtml inside it.
Then also i’m getting error :
Server Error in '/' Application.
The resource cannot be found.
please help me if i’m missing something.
In addition to your error the error page also shows you something like this for
Contact Us:Ensure you got an action named ContactUs inside your home controller.
and for
EnquiryEnsure you got an action named Enquiry inside your Enquiry controller.
The ActionLink method has several overrides, you are using this one:
The parameters are:
So when you specify the below you are saying, show my link text as
Contact Usand when clicked go to theContactUsaction in myHomecontroller:Make sure all your actions and controller names you specify exist.