Getting HttpReques does not contain definition for Form - Datatable server side processingCannot implicitly convert Web.Http.Results.JsonResult to Web.Mvc.JsonResultPOST throws HttpRequestMessage does not contain a definition for FormThe located assembly's manifest definition does not match the assembly referenceBest practice to call ConfigureAwait for all server-side codeServer Side Datatable ProcessingDatatables server side processingServer-side processing DataTableDatatables - Local Server Side ProcessingServer Side datatable crashes on processingServer side processing with datatables and flaskdatatable plugin php and json errrorDataTable with Server-side processing
Are glider winch launches rarer in the USA than in the rest of the world? Why?
Where to place an artificial gland in the human body?
How did C64 games handle music during gameplay?
Spoken encryption
What to do when you reach a conclusion and find out later on that someone else already did?
USA: Can a witness take the 5th to avoid perjury?
Are gangsters hired to attack people at a train station classified as a terrorist attack?
What do I do when a student working in my lab "ghosts" me?
What is a reasonable time for modern human society to adapt to dungeons?
Why do websites not use the HaveIBeenPwned API to warn users about exposed passwords?
High income, sudden windfall
What does the minus sign mean in measurements in datasheet footprint drawings?
How much damage does a magic stone cause when hurled from a sling?
Current relevance: "She has broken her leg" vs. "She broke her leg yesterday"
What do teaching faculty do during semester breaks?
How do I run a game when my PCs have different approaches to combat?
kids pooling money for Lego League and taxes
Terence Tao - type books in other fields?
No-cloning theorem does not seem precise
What is a Union Word™?
What are the exact meanings of roll, pitch and yaw?
Inadvertently nuked my disk permission structure - why?
Can two figures have the same area, perimeter, and same number of segments have different shape?
What exactly makes a General Products hull nearly indestructible?
Getting HttpReques does not contain definition for Form - Datatable server side processing
Cannot implicitly convert Web.Http.Results.JsonResult to Web.Mvc.JsonResultPOST throws HttpRequestMessage does not contain a definition for FormThe located assembly's manifest definition does not match the assembly referenceBest practice to call ConfigureAwait for all server-side codeServer Side Datatable ProcessingDatatables server side processingServer-side processing DataTableDatatables - Local Server Side ProcessingServer Side datatable crashes on processingServer side processing with datatables and flaskdatatable plugin php and json errrorDataTable with Server-side processing
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have the following server side code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using AutoMapper;
using myProject.Models;
using System.Web.Http;
using MyProject.Dtos;
using System.Web.Mvc;
using System.Linq.Dynamic;
using System.Data.Entity;
public class MembersController: Controller
public MembersController()
_context = new ApplicationDbContext();
public ActionResult GetMembers(string query = null)
try
//Creating instance of DatabaseContext class
using (_context)
var draw = Request.Form.GetValues("draw").FirstOrDefault();
var start = Request.Form.GetValues("start").FirstOrDefault();
var length = Request.Form.GetValues("length").FirstOrDefault();
//Paging Size (10,20,50,100)
int pageSize = length != null ? Convert.ToInt32(length) : 0;
int skip = start != null ? Convert.ToInt32(start) : 0;
int recordsTotal = 0;
// Getting all member data
var membersQuery = _context.Members.ToList();
//total number of rows count
recordsTotal = membersQuery.Count();
//Paging
var data = membersQuery.Skip(skip).Take(pageSize).ToList();
////Returning Json Data
return Json(new draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data );
catch (Exception)
throw;
Here's my view:
var table = $("#members").DataTable(
"processing": true, // for show progress bar
"serverSide": true,
"pageLength":5,
ajax:
url: "/api/members",
dataSrc: "",
"type": "POST",
"datatype": "json"
,
columns: [
data: "cardNumber"
,
data: "registrationDate",
,
data: "fullName",
,
data: "address"
,
data: "phoneNumber"
,
data: "email"
]
);
I am getting the following compile errors:
Error CS1061 'HttpRequestMessage' does not contain a definition for 'Form' and no accessible extension method 'Form' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)
Error CS0029 Cannot implicitly convert type 'System.Web.Http.Results.JsonResult< data>>' to 'System.Web.Mvc.ActionResult'
I am following this tutorial for guidance.
Will appreciate your help
c# json asp.net-mvc datatables
add a comment |
I have the following server side code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using AutoMapper;
using myProject.Models;
using System.Web.Http;
using MyProject.Dtos;
using System.Web.Mvc;
using System.Linq.Dynamic;
using System.Data.Entity;
public class MembersController: Controller
public MembersController()
_context = new ApplicationDbContext();
public ActionResult GetMembers(string query = null)
try
//Creating instance of DatabaseContext class
using (_context)
var draw = Request.Form.GetValues("draw").FirstOrDefault();
var start = Request.Form.GetValues("start").FirstOrDefault();
var length = Request.Form.GetValues("length").FirstOrDefault();
//Paging Size (10,20,50,100)
int pageSize = length != null ? Convert.ToInt32(length) : 0;
int skip = start != null ? Convert.ToInt32(start) : 0;
int recordsTotal = 0;
// Getting all member data
var membersQuery = _context.Members.ToList();
//total number of rows count
recordsTotal = membersQuery.Count();
//Paging
var data = membersQuery.Skip(skip).Take(pageSize).ToList();
////Returning Json Data
return Json(new draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data );
catch (Exception)
throw;
Here's my view:
var table = $("#members").DataTable(
"processing": true, // for show progress bar
"serverSide": true,
"pageLength":5,
ajax:
url: "/api/members",
dataSrc: "",
"type": "POST",
"datatype": "json"
,
columns: [
data: "cardNumber"
,
data: "registrationDate",
,
data: "fullName",
,
data: "address"
,
data: "phoneNumber"
,
data: "email"
]
);
I am getting the following compile errors:
Error CS1061 'HttpRequestMessage' does not contain a definition for 'Form' and no accessible extension method 'Form' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)
Error CS0029 Cannot implicitly convert type 'System.Web.Http.Results.JsonResult< data>>' to 'System.Web.Mvc.ActionResult'
I am following this tutorial for guidance.
Will appreciate your help
c# json asp.net-mvc datatables
add a comment |
I have the following server side code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using AutoMapper;
using myProject.Models;
using System.Web.Http;
using MyProject.Dtos;
using System.Web.Mvc;
using System.Linq.Dynamic;
using System.Data.Entity;
public class MembersController: Controller
public MembersController()
_context = new ApplicationDbContext();
public ActionResult GetMembers(string query = null)
try
//Creating instance of DatabaseContext class
using (_context)
var draw = Request.Form.GetValues("draw").FirstOrDefault();
var start = Request.Form.GetValues("start").FirstOrDefault();
var length = Request.Form.GetValues("length").FirstOrDefault();
//Paging Size (10,20,50,100)
int pageSize = length != null ? Convert.ToInt32(length) : 0;
int skip = start != null ? Convert.ToInt32(start) : 0;
int recordsTotal = 0;
// Getting all member data
var membersQuery = _context.Members.ToList();
//total number of rows count
recordsTotal = membersQuery.Count();
//Paging
var data = membersQuery.Skip(skip).Take(pageSize).ToList();
////Returning Json Data
return Json(new draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data );
catch (Exception)
throw;
Here's my view:
var table = $("#members").DataTable(
"processing": true, // for show progress bar
"serverSide": true,
"pageLength":5,
ajax:
url: "/api/members",
dataSrc: "",
"type": "POST",
"datatype": "json"
,
columns: [
data: "cardNumber"
,
data: "registrationDate",
,
data: "fullName",
,
data: "address"
,
data: "phoneNumber"
,
data: "email"
]
);
I am getting the following compile errors:
Error CS1061 'HttpRequestMessage' does not contain a definition for 'Form' and no accessible extension method 'Form' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)
Error CS0029 Cannot implicitly convert type 'System.Web.Http.Results.JsonResult< data>>' to 'System.Web.Mvc.ActionResult'
I am following this tutorial for guidance.
Will appreciate your help
c# json asp.net-mvc datatables
I have the following server side code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using AutoMapper;
using myProject.Models;
using System.Web.Http;
using MyProject.Dtos;
using System.Web.Mvc;
using System.Linq.Dynamic;
using System.Data.Entity;
public class MembersController: Controller
public MembersController()
_context = new ApplicationDbContext();
public ActionResult GetMembers(string query = null)
try
//Creating instance of DatabaseContext class
using (_context)
var draw = Request.Form.GetValues("draw").FirstOrDefault();
var start = Request.Form.GetValues("start").FirstOrDefault();
var length = Request.Form.GetValues("length").FirstOrDefault();
//Paging Size (10,20,50,100)
int pageSize = length != null ? Convert.ToInt32(length) : 0;
int skip = start != null ? Convert.ToInt32(start) : 0;
int recordsTotal = 0;
// Getting all member data
var membersQuery = _context.Members.ToList();
//total number of rows count
recordsTotal = membersQuery.Count();
//Paging
var data = membersQuery.Skip(skip).Take(pageSize).ToList();
////Returning Json Data
return Json(new draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data );
catch (Exception)
throw;
Here's my view:
var table = $("#members").DataTable(
"processing": true, // for show progress bar
"serverSide": true,
"pageLength":5,
ajax:
url: "/api/members",
dataSrc: "",
"type": "POST",
"datatype": "json"
,
columns: [
data: "cardNumber"
,
data: "registrationDate",
,
data: "fullName",
,
data: "address"
,
data: "phoneNumber"
,
data: "email"
]
);
I am getting the following compile errors:
Error CS1061 'HttpRequestMessage' does not contain a definition for 'Form' and no accessible extension method 'Form' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)
Error CS0029 Cannot implicitly convert type 'System.Web.Http.Results.JsonResult< data>>' to 'System.Web.Mvc.ActionResult'
I am following this tutorial for guidance.
Will appreciate your help
c# json asp.net-mvc datatables
c# json asp.net-mvc datatables
asked Mar 26 at 16:08
bangbangbangbang
5471 gold badge4 silver badges18 bronze badges
5471 gold badge4 silver badges18 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Both exception messages are related each other, and seem originated from this using
statement which was suspicious:
using System.Web.Http;
And this url
setting which implies that you want to call Web API controller from DataTable's AJAX callback:
url: "/api/members", // points to Web API controller
The first exception occurred because you're using Request
property which not originated from HttpContext.Request
that returns HttpRequest
, instead it came from another Request
property in System.Web.Http
namespace which returns HttpRequestMessage
.
The second exception occurred because return type of the controller action is System.Web.Mvc.ActionResult
, while your Json()
method might return System.Web.Http.Results.JsonResult
which is part of Web API.
Judging from your AJAX URL and controller action, you have 2 options:
1) If you're using MVC controller, remove System.Web.Http
namespace and make sure you're using Request
from HttpContext.Current
like example below:
var draw = HttpContext.Current.Request.Form.GetValues("draw").FirstOrDefault();
var start = HttpContext.Current.Request.Form.GetValues("start").FirstOrDefault();
var length = HttpContext.Current.Request.Form.GetValues("length").FirstOrDefault();
Then you need to replace AJAX call in DataTable
to call the action name like this:
ajax:
url: '@Url.Action("GetMember", "Members")',
data: ..., // set your data here
type: "POST",
dataType: "json"
,
2) If you're using Web API controller, replace System.Web.Mvc.Controller
inheritance with System.Web.Http.ApiController
, then use proper way to return JSON string from Web API controller:
public class MembersController: ApiController
// ctor
public MembersController()
_context = new ApplicationDbContext();
public IHttpActionResult GetMembers([FromBody] ViewModel model)
try
//Creating instance of DatabaseContext class
using (_context)
var draw = model.Draw;
var start = model.Start;
var length = model.Length;
// skipped for brevity
return Ok(new draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data );
catch (Exception)
// error handling
If you choose this approach, you can leave the URL /api/Members
as is but the AJAX call's data
/dataSrc
parameter from DataTable
should be modified to pass the viewmodel object because Request
property from Web API doesn't have Form
property as its member.
Related issues:
POST throws HttpRequestMessage does not contain a definition for Form
Cannot implicitly convert Web.Http.Results.JsonResult to Web.Mvc.JsonResult
Hi @Tetsuya, thanks for your insights. I opted for option 1 (MVC Controller) and when I started to debug, I got the following exception on the very first line where it tries to read the value of "draw". This is what I got: Value cannot be null. Parameter name: source
– bangbang
Mar 27 at 16:35
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55361591%2fgetting-httpreques-does-not-contain-definition-for-form-datatable-server-side%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Both exception messages are related each other, and seem originated from this using
statement which was suspicious:
using System.Web.Http;
And this url
setting which implies that you want to call Web API controller from DataTable's AJAX callback:
url: "/api/members", // points to Web API controller
The first exception occurred because you're using Request
property which not originated from HttpContext.Request
that returns HttpRequest
, instead it came from another Request
property in System.Web.Http
namespace which returns HttpRequestMessage
.
The second exception occurred because return type of the controller action is System.Web.Mvc.ActionResult
, while your Json()
method might return System.Web.Http.Results.JsonResult
which is part of Web API.
Judging from your AJAX URL and controller action, you have 2 options:
1) If you're using MVC controller, remove System.Web.Http
namespace and make sure you're using Request
from HttpContext.Current
like example below:
var draw = HttpContext.Current.Request.Form.GetValues("draw").FirstOrDefault();
var start = HttpContext.Current.Request.Form.GetValues("start").FirstOrDefault();
var length = HttpContext.Current.Request.Form.GetValues("length").FirstOrDefault();
Then you need to replace AJAX call in DataTable
to call the action name like this:
ajax:
url: '@Url.Action("GetMember", "Members")',
data: ..., // set your data here
type: "POST",
dataType: "json"
,
2) If you're using Web API controller, replace System.Web.Mvc.Controller
inheritance with System.Web.Http.ApiController
, then use proper way to return JSON string from Web API controller:
public class MembersController: ApiController
// ctor
public MembersController()
_context = new ApplicationDbContext();
public IHttpActionResult GetMembers([FromBody] ViewModel model)
try
//Creating instance of DatabaseContext class
using (_context)
var draw = model.Draw;
var start = model.Start;
var length = model.Length;
// skipped for brevity
return Ok(new draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data );
catch (Exception)
// error handling
If you choose this approach, you can leave the URL /api/Members
as is but the AJAX call's data
/dataSrc
parameter from DataTable
should be modified to pass the viewmodel object because Request
property from Web API doesn't have Form
property as its member.
Related issues:
POST throws HttpRequestMessage does not contain a definition for Form
Cannot implicitly convert Web.Http.Results.JsonResult to Web.Mvc.JsonResult
Hi @Tetsuya, thanks for your insights. I opted for option 1 (MVC Controller) and when I started to debug, I got the following exception on the very first line where it tries to read the value of "draw". This is what I got: Value cannot be null. Parameter name: source
– bangbang
Mar 27 at 16:35
add a comment |
Both exception messages are related each other, and seem originated from this using
statement which was suspicious:
using System.Web.Http;
And this url
setting which implies that you want to call Web API controller from DataTable's AJAX callback:
url: "/api/members", // points to Web API controller
The first exception occurred because you're using Request
property which not originated from HttpContext.Request
that returns HttpRequest
, instead it came from another Request
property in System.Web.Http
namespace which returns HttpRequestMessage
.
The second exception occurred because return type of the controller action is System.Web.Mvc.ActionResult
, while your Json()
method might return System.Web.Http.Results.JsonResult
which is part of Web API.
Judging from your AJAX URL and controller action, you have 2 options:
1) If you're using MVC controller, remove System.Web.Http
namespace and make sure you're using Request
from HttpContext.Current
like example below:
var draw = HttpContext.Current.Request.Form.GetValues("draw").FirstOrDefault();
var start = HttpContext.Current.Request.Form.GetValues("start").FirstOrDefault();
var length = HttpContext.Current.Request.Form.GetValues("length").FirstOrDefault();
Then you need to replace AJAX call in DataTable
to call the action name like this:
ajax:
url: '@Url.Action("GetMember", "Members")',
data: ..., // set your data here
type: "POST",
dataType: "json"
,
2) If you're using Web API controller, replace System.Web.Mvc.Controller
inheritance with System.Web.Http.ApiController
, then use proper way to return JSON string from Web API controller:
public class MembersController: ApiController
// ctor
public MembersController()
_context = new ApplicationDbContext();
public IHttpActionResult GetMembers([FromBody] ViewModel model)
try
//Creating instance of DatabaseContext class
using (_context)
var draw = model.Draw;
var start = model.Start;
var length = model.Length;
// skipped for brevity
return Ok(new draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data );
catch (Exception)
// error handling
If you choose this approach, you can leave the URL /api/Members
as is but the AJAX call's data
/dataSrc
parameter from DataTable
should be modified to pass the viewmodel object because Request
property from Web API doesn't have Form
property as its member.
Related issues:
POST throws HttpRequestMessage does not contain a definition for Form
Cannot implicitly convert Web.Http.Results.JsonResult to Web.Mvc.JsonResult
Hi @Tetsuya, thanks for your insights. I opted for option 1 (MVC Controller) and when I started to debug, I got the following exception on the very first line where it tries to read the value of "draw". This is what I got: Value cannot be null. Parameter name: source
– bangbang
Mar 27 at 16:35
add a comment |
Both exception messages are related each other, and seem originated from this using
statement which was suspicious:
using System.Web.Http;
And this url
setting which implies that you want to call Web API controller from DataTable's AJAX callback:
url: "/api/members", // points to Web API controller
The first exception occurred because you're using Request
property which not originated from HttpContext.Request
that returns HttpRequest
, instead it came from another Request
property in System.Web.Http
namespace which returns HttpRequestMessage
.
The second exception occurred because return type of the controller action is System.Web.Mvc.ActionResult
, while your Json()
method might return System.Web.Http.Results.JsonResult
which is part of Web API.
Judging from your AJAX URL and controller action, you have 2 options:
1) If you're using MVC controller, remove System.Web.Http
namespace and make sure you're using Request
from HttpContext.Current
like example below:
var draw = HttpContext.Current.Request.Form.GetValues("draw").FirstOrDefault();
var start = HttpContext.Current.Request.Form.GetValues("start").FirstOrDefault();
var length = HttpContext.Current.Request.Form.GetValues("length").FirstOrDefault();
Then you need to replace AJAX call in DataTable
to call the action name like this:
ajax:
url: '@Url.Action("GetMember", "Members")',
data: ..., // set your data here
type: "POST",
dataType: "json"
,
2) If you're using Web API controller, replace System.Web.Mvc.Controller
inheritance with System.Web.Http.ApiController
, then use proper way to return JSON string from Web API controller:
public class MembersController: ApiController
// ctor
public MembersController()
_context = new ApplicationDbContext();
public IHttpActionResult GetMembers([FromBody] ViewModel model)
try
//Creating instance of DatabaseContext class
using (_context)
var draw = model.Draw;
var start = model.Start;
var length = model.Length;
// skipped for brevity
return Ok(new draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data );
catch (Exception)
// error handling
If you choose this approach, you can leave the URL /api/Members
as is but the AJAX call's data
/dataSrc
parameter from DataTable
should be modified to pass the viewmodel object because Request
property from Web API doesn't have Form
property as its member.
Related issues:
POST throws HttpRequestMessage does not contain a definition for Form
Cannot implicitly convert Web.Http.Results.JsonResult to Web.Mvc.JsonResult
Both exception messages are related each other, and seem originated from this using
statement which was suspicious:
using System.Web.Http;
And this url
setting which implies that you want to call Web API controller from DataTable's AJAX callback:
url: "/api/members", // points to Web API controller
The first exception occurred because you're using Request
property which not originated from HttpContext.Request
that returns HttpRequest
, instead it came from another Request
property in System.Web.Http
namespace which returns HttpRequestMessage
.
The second exception occurred because return type of the controller action is System.Web.Mvc.ActionResult
, while your Json()
method might return System.Web.Http.Results.JsonResult
which is part of Web API.
Judging from your AJAX URL and controller action, you have 2 options:
1) If you're using MVC controller, remove System.Web.Http
namespace and make sure you're using Request
from HttpContext.Current
like example below:
var draw = HttpContext.Current.Request.Form.GetValues("draw").FirstOrDefault();
var start = HttpContext.Current.Request.Form.GetValues("start").FirstOrDefault();
var length = HttpContext.Current.Request.Form.GetValues("length").FirstOrDefault();
Then you need to replace AJAX call in DataTable
to call the action name like this:
ajax:
url: '@Url.Action("GetMember", "Members")',
data: ..., // set your data here
type: "POST",
dataType: "json"
,
2) If you're using Web API controller, replace System.Web.Mvc.Controller
inheritance with System.Web.Http.ApiController
, then use proper way to return JSON string from Web API controller:
public class MembersController: ApiController
// ctor
public MembersController()
_context = new ApplicationDbContext();
public IHttpActionResult GetMembers([FromBody] ViewModel model)
try
//Creating instance of DatabaseContext class
using (_context)
var draw = model.Draw;
var start = model.Start;
var length = model.Length;
// skipped for brevity
return Ok(new draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data );
catch (Exception)
// error handling
If you choose this approach, you can leave the URL /api/Members
as is but the AJAX call's data
/dataSrc
parameter from DataTable
should be modified to pass the viewmodel object because Request
property from Web API doesn't have Form
property as its member.
Related issues:
POST throws HttpRequestMessage does not contain a definition for Form
Cannot implicitly convert Web.Http.Results.JsonResult to Web.Mvc.JsonResult
answered Mar 27 at 3:39
Tetsuya YamamotoTetsuya Yamamoto
17.6k4 gold badges25 silver badges42 bronze badges
17.6k4 gold badges25 silver badges42 bronze badges
Hi @Tetsuya, thanks for your insights. I opted for option 1 (MVC Controller) and when I started to debug, I got the following exception on the very first line where it tries to read the value of "draw". This is what I got: Value cannot be null. Parameter name: source
– bangbang
Mar 27 at 16:35
add a comment |
Hi @Tetsuya, thanks for your insights. I opted for option 1 (MVC Controller) and when I started to debug, I got the following exception on the very first line where it tries to read the value of "draw". This is what I got: Value cannot be null. Parameter name: source
– bangbang
Mar 27 at 16:35
Hi @Tetsuya, thanks for your insights. I opted for option 1 (MVC Controller) and when I started to debug, I got the following exception on the very first line where it tries to read the value of "draw". This is what I got: Value cannot be null. Parameter name: source
– bangbang
Mar 27 at 16:35
Hi @Tetsuya, thanks for your insights. I opted for option 1 (MVC Controller) and when I started to debug, I got the following exception on the very first line where it tries to read the value of "draw". This is what I got: Value cannot be null. Parameter name: source
– bangbang
Mar 27 at 16:35
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55361591%2fgetting-httpreques-does-not-contain-definition-for-form-datatable-server-side%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown