Please Login to Continue

Free Software Development Articles.Email List

Advertise Here

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> Core 3.1 mvc core errors web forms core tutorial Technology published
Buy Me Coffee

Was this page helpful?

Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful..

© 2020 - ErnesTech - Privacy