I've got a partial view where you can subscribe to a newsletter. When hitting post I would like it to just update the partial with a message. Not full redirect/postback.
Here is my POST action
[HttpPost]
public async Task<ActionResult> HandleSubscription(Models.NewsletterViewModel model)
{
if (!ModelState.IsValid)
{
return CurrentUmbracoPage();
}
.......bla bla bla.............
//Call webapi to get data
var returnValue = new MyApiController().SignUpNewsletter(model.Email);
model.ReturnValue = returnValue;
PartialView("Newsletter", model);
}
This returns a blank page with the partial. How do I only update the partial?
Partial View async rendering after POST
I've got a partial view where you can subscribe to a newsletter. When hitting post I would like it to just update the partial with a message. Not full redirect/postback.
Here is my POST action
This returns a blank page with the partial. How do I only update the partial?
The view looks something like this:
And of course there should be a "return" before PartialView("Newsletter", model); in the first post.
is working on a reply...