.NET equivalent to .php " ->where( 'site', $_POST['site'] )"
.NET equivalent to .php " ->where( 'site', $_POST['site'] )"
I'm implementing a parent-child relationship as described here: https://datatables.net/blog/2016-03-25
I've got parent data coming through, and when I hard code a value into the .Where clause of the related ApiController, the 'child' table returns data. Of course what I really want is for the child tables data to be dictated by the parent selection....
I've scoured through the Editor for .NET examples, but can't find one where a parameter is being passed to the controller and eventually seeds the 'where' clause that lives there.
The example at the link given above shows server-side .php notation to get the parameter from the selection made on the parent table: " ->where( 'site', $_POST['site'] )"
Much obliged if someone can point me to a source, or knows, the .NET equivalent to this line of code?
This question has accepted answers - jump to:
Answers
request.Form["propertyName"]
should do it - for example:I don't actually have VS on this machine so its possible I've done something daft there, and I can't for the life of me remember the syntax for returning an empty JSON object on error, but that should do the job.
Allan
Thank you thank you! I had found reference to 'request.Form', but I was typing 'Request' capital 'R'.... Gargh, I've got some learning to do.
Best,
-jorm
Funnily enough
Request
I think would work on an MVC page (can't remember for certain, but I've used it a few times myself somewhere and think it was there...).The number of "globals" has been much cause of grief for me too - you aren't alone .
Allan