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
Im using Umbraco7 with MVC engine.
I have some partial view control and im unable to set a simple post method (for ajax) which returns my custom web model. I also checked the link (which didn't quite help me): http://our.umbraco.org/documentation/Reference/Mvc/partial-views
my main problem is that the partial view doesn't load correctly, also, if there are any examples out there i'll thank you if u can add a link/provide some code example.
anyway, my code includes:cshtml
@inherits Umbraco.Web.Macros.PartialViewMacroPage @model Umb7MVC.Models.MyCustomModel
<section class="wrapper" id="home">..some html</section> <strong>@Model.MyProperty</strong>HomeController
[HttpPost] public JsonResult Index(MyCustomModelmodel) { model.MyProperty = "some value"; return Json(new { result = "ok" }); }
custom model
public class MyCustomModel { public string MyProperty { get; set; } }
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
A model under partial view doesn't work
Im using Umbraco7 with MVC engine.
I have some partial view control and im unable to set a simple post method (for ajax) which returns my custom web model. I also checked the link (which didn't quite help me): http://our.umbraco.org/documentation/Reference/Mvc/partial-views
my main problem is that the partial view doesn't load correctly, also, if there are any examples out there i'll thank you if u can add a link/provide some code example.
anyway, my code includes:
cshtml
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@model Umb7MVC.Models.MyCustomModel
<section class="wrapper" id="home">..some html</section>
<strong>@Model.MyProperty</strong>
HomeController
[HttpPost]
public JsonResult Index(MyCustomModelmodel)
{
model.MyProperty = "some value";
return Json(new { result = "ok" });
}
custom model
public class MyCustomModel
{
public string MyProperty { get; set; }
}
is working on a reply...