PDA

View Full Version : [CLOSED] MVC Force Post



adelaney
May 10, 2012, 9:05 PM
When Setting up a proxy, how do I force the Ajax to POST and not GET?

Example:

.Proxy(Sub(proxy)
proxy.Add(Html.X.AjaxProxy().Url(Url.Content("~/Assignments") + "/_GetTeams/" + MvcApplication.CurrentApplicationUser.EmployeeID.T oString()) _
.Reader(Sub(rdr)
rdr.Add(Html.X.JsonReader().Root("Data"))
End Sub) _
.Writer(Sub(wrtr)
wrtr.Add(Html.X.JsonWriter().Root("Data"))
End Sub))
End Sub) _

Daniil
May 10, 2012, 9:40 PM
Hi,

Please set up ActionMethods Read.

Example (C#)

.Proxy(proxy =>
proxy.Add(Html.X().AjaxProxy()
.ActionMethods(methods =>
methods.Read = HttpMethod.POST
)
)
)

adelaney
May 11, 2012, 1:38 PM
Weird. I don't have an "ActionMethods" method from the AjaxProxy object. Was this in since the beta release or was this added with the RC version?

Daniil
May 11, 2012, 1:46 PM
Seems it was added after Beta release. So, please update from SVN.