开发者

"404 Not Found" error in mvc

i am using asp.net mvc 2开发者_如何学JAVA.0. in that i am using partial views but whenever i clicked on particular link i get the follwing error

404 Not Found

can any one konw the solution the application run properly at local host but it shows the error when i uploaded on the server. thanks.


How did you generate the links? You should always use Html.ActionLink() or Url.Action() to generate links, to avoid problems when deploying.

For example, if you want to link to /Ctrl/Act/123 you should not use this:

<a href="/Crtl/Act/123">Here</a>

but this:

<%=Html.ActionLink("Here", "Act", "Ctrl", new { id = ""}, new {}) %>


Check your servers error log. There must be 404 error details.

Open the network tab in FireBug reload the page and trigger the "wrong" request. And then check where the request goes to. FireBug catches all request a browser send.


The top answer to the following question worked for me:

ASP.NET MVC2: Can't find controller

Add IIS application wildcard mapping to C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll

Installing Wildcard Application Mappings (IIS 6.0)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜