1

Topic: TypeScript: Send NULL to Server ASP.NET MVC

:
FrontEnd: TypeScript
BackEnd: ASP.NET MVC
I transfer given to the server:

var dataString =
' SysSettingID=null ';
$.ajax ({
type: ' PUT ';
data: dataString;
url: url,//funHostName () + '/api/SysSettings / ' + SysSettingID + ' / ';
success: function (data) {
...

On the server the normal controler accepts this data:

public async Task <IHttpActionResult> PutSysSetting (int id, SysSetting sysSetting)
{
if (! ModelState. IsValid) {...}
}

Value sysSetting. SysSettingID accepts parameter as a line "null" . In it and a problem!
THE ITEM WITH.
In ExtJS all is perfectly transferred, as null , and here in JQuery/TypeScript as the LINE .

2

Re: TypeScript: Send NULL to Server ASP.NET MVC

Tried on a miscellaneous:

var dataString = ' SysSettingID = ' + null;
var dataString = ' SysSettingID=null ';
var dataString = ' SysSettingID = ' + undefined;
var dataString = ' SysSettingID=undefined ';

3

Re: TypeScript: Send NULL to Server ASP.NET MVC

And if so?

...
data: {SysSettingID: ""};
...