jquery - Ajax Json Data null at Controller -


I am holding posts in my controller, but string form data is zero. Because of this, I'm unable to use the anti-web feature, as it seems that all data is lost, maybe I serialzeArray ?

My post should not use

  $ ("#SetCommunicationSettingsForm"). Submit (function (e) {Debugger; var postData = $ (this) .serializeArray (); var formURL = $ (this) .attr ( "action"); $ .ajax ({url: formURL, as follows: "Post "datatype" Jason ", data: Postdeta, success: function (data) {debugger; // data: return to server data if (data.success == true) {$ (" # Sevsyuefsful "). show () ; $ ( "# set Sncharnfrmaria"). ( "# Sumbitcommunity.SettingForm"). $ ( "# SumbitCommunicationSettingForm"). Val ( '& lt;%: ServiceSite.Resources.Resources.COMMON_CLOSE% & gt;'); $ ( "# SumbitCommunicationSettingForm"). Unbind ( 'click'); $ ( "#SumbitCommunicationSettingForm"). CLIC K (closeCommunicationSettingPopup); $ ( "# CancelCommuncationSettingButton") hide () .;} au {$ ( "# Device Kmuneshn setting position"). Html (data);}}}); e.preventDefault (); // STOP default action}); My Controller:  
  [httpost] // [authorizeActionFilter] // [Valid Antiforganic Token (salt = "Update Communication Notices")) Public Action Updated communication communication (string formata)) {// decode parameters JavaScriptSerializer ser = new JavaScript Serializer (); Dictionary & lt; String, Object & gt; JsonParams = ser.Deserialize & lt; Dictionary & lt; String, Object & gt; & Gt; (FormData); // verify permissions on the server (if "(list (& lt; string & gt;) Session [" authorized operations "]). This includes (" Snpadndiwais Sncharsucnaan ")) from {// Bilddidadetakdiwais configuration model setting, near the DAL to save the list & lt; long & gt; DeviceIds = GetSelectedDevicesFromSession (); Agrgn device (long id IID) {} return partial view ( "device Kmunikeshnseting dialog");} else {return Jason (New {notuthorized = true});}}    

You are posting a json object and no string.
Technically you can convert json to a string:

  var jsonStr = JSON.stringify (json);  

Instead of doing so, Try using FormCollection:

  Public Performance UpdateContent settings (Form Collection FormsData) {}  

You have to leave the serial.

< P> You can call JS on class You can use the knowledge schema class, and it will work with the binding.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -