当前位置: 动力学知识库 > 问答 > 编程问答 >

html - ASP.NET View redirect

问题描述:

In my layout I have a menu with links one of which is:

<li><a href="@Url.Action("Whatistesting", "Testing")">What is testing</a></li>

On localhost this link works as expected and redirects to the appropriate controller and appropriate action. But i've published and all i get a 404 errors yet the path indicated is exactly what it ought to be. Any ideas?

网友答案:

Guys thanks but i got it to work using this solution after Googling a bit One reason this could occur is if you don't have a start page set under your web project's properties. So do this:

Right click on your mvc project
Choose "Properties"
Select the "Web" tab
Select "Specific Page"
Assuming you have a controller called HomeController and an action method called Index, enter "home/index" in to the text box corresponding to the "Specific Page" radio button.
分享给朋友:
您可能感兴趣的文章:
随机阅读: