using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Mvc;
using Umbraco.Web.Mvc;
public class TestSurfaceController : SurfaceController
{
[HttpPost]
public ActionResult GetMyBigCalendarMessage(int id)
{
return PartialView("~/Views/Partials/_ThirdPartial.cshtml", tvm);
}
}
Sorry for the bad formatting. Thanks for your time.
I've had issues trying to use a single Int as a variable in a POST - MVC seems to expect and only match methods on an object - use a model / simple object instead or change it to a GET and add the data to the URL you're posting.
Stick a break point on your surface controller method to ensure it's routing it correctly.
SurfaceController not working with jquery ajax POST
Hi.
I am using Umbraco 7.2 and I am trying to update a div element using jquery ajax.
Let me show you what I have so far.
Through Umbraco CMS I have created a Template and some partial views.
MyTemplate.cshtml...
Views/Partials/_FirstPartial.cshtml...
Controllers/TestSurfaceController.cs...
Sorry for the bad formatting. Thanks for your time.
The JSON parameter in your Ajax call needs to have the same name as in your controller.
I've had issues trying to use a single Int as a variable in a POST - MVC seems to expect and only match methods on an object - use a model / simple object instead or change it to a GET and add the data to the URL you're posting.
Stick a break point on your surface controller method to ensure it's routing it correctly.
Hi Raymond,
as Steve mention, you can´t use attributes like that on a post-method. Try take a look at this Gist to get the hang of how it is done: https://gist.github.com/rpjengaard/a80d369f1eff3a266faa
Best regards
René
is working on a reply...