Editor data in Create Controller
Editor data in Create Controller
The editor plugin is very confusing to learn how to use. Therefore I decided to dumb this down to a basic simple task. Using the editor to create a record using MVC scaffolding posted via AJAX.
In the Create controller I expect to see data coming in looking like this;
Instead I am getting data coming into the controller looking like this;
How can I pickup this data?
Typically I would pickup this data like this (below);
string GR_AirBillNumber = formCollection["GR_AirBillNumber"];
But attempting to pickup the data like this (below) does not work;
string Shop = formCollection["data[0][Day]"];
Answers
well you are so smart you answered your own question.
string test0 = collection[0].ToString();
string test1 = collection[1].ToString();
string test2 = collection[2].ToString();
etc...
Hi,
The way Editor submits data is described here. It uses HTTP parameters with names that are typically parsed by the server-side. This is not the case in .NET unfortunately. However, there are a few options:
DtRequest
class which can transform the input into a .NET object.ajax.data
to send JSON to the server rather than HTTP parameters. Then you can deserialise it using JSON.NET or similar.Allan
Hi Alan,
Thanks for jumping in here.
Unfortunately using the dll isn't a easy option for me (described in more detail in an adjacent post).
Do you by chance have code samples to help pave the way for using option #2 and option #3?
I've replied [in your other thread](https://datatables.net/forums/discussion/75627/editor-on-record-create-insert-form-data-does-not-automatically-refresh#latest.
Allan