AnimaSola
AnimaSola

Reputation: 7846

Accessing fields on DriverResult Editor POST in Orchard CMS 1.7

crosspost: https://orchard.codeplex.com/discussions/473252

When updating Content Items back in 1.6, I was able to get field values on POST from the HttpContext like below:

var lat = HttpContext.Current.Request["Latitude"];

Ever since 1.7, those return null and upon inspecting the request, it doesn't have those properties. I checked some more and couldn't find the fields anymore. I even tried injecting the IHttpContextAccessor but still nothing.

Does anyone know where they are held now?

Any piece of advise or information would be highly appreciated, thanks!

Upvotes: 0

Views: 139

Answers (1)

Bertrand Le Roy
Bertrand Le Roy

Reputation: 17814

Do not access post data directly. Use model binding instead. This can be done either with specifically typed and named parameters on a controller action, or through the TryUpdateModel method that is available from driver post methods.

Upvotes: 1

Related Questions