Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a partial called BottomNavigation.cshtml in my Views/Partials folder. I am trying the following:
$("#footer").load("../Views/Partials/BottomNavigation.cshtml");
But it says 404 not found. Is this possible? Currently, I am doing:
@{Html.RenderPartial("BottomNavigation.cshtml");} which does work.
@{Html.RenderPartial("BottomNavigation.cshtml");}
Hi!
Is it a static file or does it need a model to render? This should work for static content:
public ActionResult GetPartial(string partialName){ return PartialView("~/Views/Partials/"+partialName); }
then
$("#footer").load("../MyController/GetPartial?partialName=BottomNavigation");
May I ask you what you are trying to achieve by loading it as ajax?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Load cshtml with jquery.load
I have a partial called BottomNavigation.cshtml in my Views/Partials folder. I am trying the following:
But it says 404 not found. Is this possible? Currently, I am doing:
@{Html.RenderPartial("BottomNavigation.cshtml");}
which does work.Hi!
Is it a static file or does it need a model to render?
This should work for static content:
then
May I ask you what you are trying to achieve by loading it as ajax?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.