20978

Access JSON Stringified data on Server side

Question:

I want to use the JSON Stringified Array on the server side ::

The FOrmat of Sent Stringified data is::

task:[{"TaskID":4,"OwnerID":1,"RecurrenceID":null,"Title":"Test Title1234","Description":"Desc... ","Start":"2014-04-28T01:00:00.000Z","End":"2014-04-30T06:00:00.000Z","RecurrenceRule":"","RecurrenceException":"Task Exception Occured","IsAllDay":false}]

And on Server Side I am trying to access is as::

public virtual JsonResult Test_UpdateSchedule(IList<SchedulerViewModel> task) { //Implementation Code }

But I am not able to access it here.

My FOrmat of ViewModel is as below::

public class SchedulerViewModel { public int TaskID { get; set; } public string Title { get; set; } public string Description { get; set; } public DateTime Start{get;set;} public DateTime End{get;set;} public string RecurrenceRule { get; set; } public int? RecurrenceID { get; set; } public string RecurrenceException { get; set; } public bool IsAllDay { get; set; } public int? OwnerID { get; set; } public string StartTimezone { get; set; } public string EndTimezone { get; set; } }

Answer1:

Make sure your request is a POST and that your content type is application/json.

If you post how you're passing the data that might help us answer.

Recommend

  • How can I solve “Type error: Argument 1 passed to App\\Http\\Controllers\\Controller::validate
  • How to replace in values in spark dataframes after recalculations?
  • Extract attribute value if child node contains this text
  • Consuming .net WCF service from Java
  • How to get the usage metrics data for the Web Application Service?
  • Stroke-dashoffset and dasharray animations not working
  • Not able to get my application logs using “cf logs my-cool-app” command (CF version 6.27)
  • Javascript Variable Scope
  • PostgreSQL GROUP BY: SELECT column on MAX of another WHERE a third column = x
  • Setting date in nodejs date object shows date as different value
  • Pushing a Nuget package to Visual Studio Online Package feed [duplicate]
  • MongoDB shell script using projection to format date and get local time
  • How can I write a where clause in SQL to filter a DATETIME column by the time of day?
  • update record in database using jdatabase
  • How to skip require in ruby?
  • Add dynamic data to line chart from mysql database with highcharts
  • Using Sax parsing to edit and write XML in VB6
  • Android app gives error “BatteryStatsImpl: reading network stats”
  • Security issues with PHP's Readfile method
  • Web.config system.webserver errors
  • How can the INSERT … ON CONFLICT (id) DO UPDATE… syntax be used with a sequence ID?
  • QLPreviewController hide print button in ios6
  • Converting a WriteableBitmap image ToArray in UWP
  • PHP buffered output depending on server setting?
  • Custom validator control occupying space even though display set to dynamic
  • ImageMagick, replace semi-transparent white with opaque white
  • Why is an OPTIONS request sent to the server?
  • Using $this when not in object context
  • Is there any way to access browser form field suggestions from JavaScript?
  • Uncaught Error: Could not find module `ember-load-initializers`
  • Resize panoramic image to fixed size
  • Volusion's generic SQL folder, functionality
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • python regex in pyparsing
  • How do you join a server to an Active Directory (domain)?
  • coudnt use logback because of log4j
  • Android Google Maps API OnLocationChanged only called once
  • costura.fody for a dll that references another dll
  • Binding checkboxes to object values in AngularJs
  • How can I use threading to 'tick' a timer to be accessed by other threads?