I use 2sxc (DNN) to pass some form data into an entity trough this js:
$2sxc(@Dnn.Module.ModuleID).webApi.post("Controller/Create", {}, {
qtitle: "@Content.title",
date: $todaydate,
user: "@Dnn.User.Username",
q1sel: $q1res,
q1val: $q1val
}
And this controller:
[HttpPost]
[DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.Admin)]
[ValidateAntiForgeryToken]
public bool Create(dynamic postController)
{
var quizvals = new Dictionary<string, object>();
quizvals.Add("qtitle", postController.qtitle.ToString());
quizvals.Add("date", postController.date.ToString());
quizvals.Add("user", postController.user.ToString());
quizvals.Add("q1sel", postController.q1sel.ToString());
App.Data.Create("Quiz10q5o_entries", quizvals, "Anonymous");
return true;
}
I tried quite a few data types and they all work fine, with or without ToString, but when any of the $vars has a 0 (zero, JS numeric), the field is passed has empty into the entity row.
Can anyone help me understand why this happens? Is some type of conversion needed here?
Best regards, João Gomes
I reviewed your work and it doesn't look like anything is wrong. It also seems to write 0 into the number field, as it should:
to me it looks like just the list-view in admin hides these values:
Could it be that this is all?