Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

The virtual path '/' maps to another application, which is not allowed Asp.net MVC

The virtual path '/' maps to another application, which is not allowed Asp.net MVC

Guest post :

I used @{Html.RenderPartial("~/Views/Shared/partialView.cshtml"); }
in my Razor it works fine when I test on VS2015 but on IIS it gives this error 
The virtual path '/' maps to another application, which is not allowed

Answer : 

Avoid using paths...say for example you want to inject a partial view in the Index of Home, what you have to do is create a view in Views>Home, mark that view as partial. Now render the partial thus @Html.RenderPartial ("nameOfPartial")
You cant render this partial elsewhere except in any page in the Home folder

Users Please post your solution too.




This post first appeared on Asp.netSourceCodes, please read the originial post: here

Share the post

The virtual path '/' maps to another application, which is not allowed Asp.net MVC

×

Subscribe to Asp.netsourcecodes

Get updates delivered right to your inbox!

Thank you for your subscription

×