javascript - Problems sending data from ClientSide to ServerSide in ASP.NET MVC 5 using Google Chrome -
I have an MVC5 application that works fine by using Internet Explorer, but when I use Google Chrome I try, I get an error, and only say "error".
Here is my javascript code:
var priv = 0; If ($ ("$ EsPrivado") is. (":" Has been checked)) {Private = 1; } $ .ajax ({type: "post", url: "/ ticket / guard", data: "{'RutEmpresa': '' + $ (" # RutEmpresa "). Val () +" ', "+" ('# CPID'): "+ $ (" # CPID "). Val () +", "+" 'ContactId': "+ $ (" # contactoID "). Val () +", "+ "'AreaEmpresaID':" + $ ("# AreaEmpresaID"). Val () + "," + "'Tipovideo':" + $ ("# TipoEventoID"). Val () + "," + "'FechaInicio' : '' $ ("#FechaInicio"). Val () + "'," + "' Descripcion ':' '$ (" # Descripcion "). Val () +"', "+" 'EsPrivado' : "+ Priv +", "+" 'xlutude': "+ latitude +", "+" 'exaggeration': "+ long + +"} ", type of content:" app / jason; charset = utf-8 ", Data type:" Jason ", success: work (msg) {o NGuardarOK (msg);}, Error: function (Ajaxsult, position) {On error (Ajaxsalt, position);}}); In addition, I made it in another way , And the problem is the same:
var priv = 0; if ($ ("$ EsPrivado"). (":" Has been checked)) {Private = 1;} Var nticket = {RutEmpresa: $ ("# RutEmpresa"). Val (), CPID: $ ("# CPID"). Val (), contactide: $ ("#contact"). Val (), AreaEmpresseid: $ ("#Airampresad"). Val (), typoventoide: $ ("tipovitoid"). Val (), Phichianuo: $ ("Fabieno"). Well (), Description: $ ("# Description"). (), Espredodo: private, extlude: latitudes, axulgitudes: long}; $ .AJX ({Type: 'Post', Content Type: "Application / Jason; Caratset = UTF-8", URL: '/ Ticket / Guarder', Data Type: 'Jason', Data: JSON.trinfif ({ntkty : NTTICT}), Traditional: True, Success: Work (msg) {onGuardarOK (msg);}, Error: Function (Ajaxsalt, Status) {onError (Ajaxsalt, Status);}}); This is the definition of my server method:
public action protector (string rootempress, long cpid, long contact iid, int airprogram, int typovatoid, string And, in other ways, I define it:
public action protector (model. Can you see that the error could be the cause error?
Please help me ...
P> data: "{'myObject':" + JSON.stringify (nticket) + "}", Controller should expect an object myObject.
Public Action Result Guards (Model.Clusticated MyAbased) Please note, I have the exact name " MyObject ".
Comments
Post a Comment