Click here to Skip to main content
14,734,763 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir

I create a mvc application and add a page in home folder named contact.aspx
and add a like in master page in folder shared as given below

<%: Html.ActionLink("contact", "contact", "Home")%>

this link is show in home page but when we click on this link it gives an error like this

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Home/contact


please help me, how can i remove this problem.

Thanks in advance
Posted

1 solution

The ActionLink method takes the arguments 'Text', 'Action', 'Controller'

Based on the parameters you have passed to it, it's looking for a method called contact on your Home controller. If this method doesn't exist, you'll see the 404 error.

Make sure that the method exists on the controller. Also, check your casing, your controller method should really be Contact and you should change your ActionLink accordingly. e.g

Html.ActionLink("Contact", "Contact", "Home")
   
v2

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




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