ASP.Net Core 2.2 Razor View Routing for Partial View not working

Question: ASP.Net Core 2.2 Razor View Routing for partial view not working

Answer: Look carefully in your asp-controller="ControllerName" asp-action="ActionName"
              - Chances are that the Action Name specified in an asp-action tag is not accurate, look again, and                         then look again.
               -Another chance is that, you renamed or overridden the Action Name or the Controller Name in the                    Controller. Look again, and then double check.
Solution: You will have to reference the actual name of the Action and the actual name of the Controller in your link tag e.g. 

//Considering this code is in a Partial View
<a asp-controller="ActualNameOfTheControllerAndNotThePrefixedName" asp-action="ActualNameOfTheActionAndNotThePrefixedOne" asp-route-ParameterName="PassInYourParameterOrArgumentInHere" asp-route-AnotherParameterName="PassAnotherParameterInHere">LinkName</a>

Edit this Article Core 3.1 mvc core errors web forms core tutorial Technology published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue

© 2021 - ErnesTech - Privacy