We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to map data from server-side with JsonResult.

I am trying to create a listview using javascirpt. Also, I am using UrlAdaptor(). To map the data from sever-side. What kind of JsonResult should I return. Please send me back with sample project that contains all necessary tokens, headers. I am using NetCore. RazorPage.


Attachment: Razorpages_9e9260da.zip

3 Replies

VK Vinoth Kumar Sundara Moorthy Syncfusion Team August 6, 2019 08:50 AM UTC

Hi Peng, 
 
Good day to you. 
 
Please refer the below documentation for getting data from server side using urlAdaptor and sample json data format. 
 
Please refer the below documentation to add the custom header with tokens,  
 
For your convenience, we have created a sample based on your requirement and the same can be downloaded from below link, 
 
 
Could you please check the above details and get back to us if you need any further assistance on this? 
 
Regards, 
Vinoth Kumar S 



PX Peng Xie August 6, 2019 04:44 PM UTC

From the document to use URLAdaptor, it says result and count keys are required, but your given example is not providing these special keys. I have issue that the format of response data. Can you please write some dummy data response to demonstrate response format. I created a post method handler. if you could please correct it.

Thanks.
Peng


VK Vinoth Kumar Sundara Moorthy Syncfusion Team August 7, 2019 12:40 PM UTC

Hi Peng, 
  
Good day to you. 
 
Query 1: I tried the way it was suggest in document, but my ListView could not map response data. 
  
We have checked your query and response data was mapping in ListView properly . For your convenience, we have prepared a sample based on documentation and the same can be downloaded from below link, 
 
 
Query 2: How do I parse out those extra properties from JSON object. 
 
We have checked your requirement and if you want use data manager for rendering the ListView items, the returned data will be based on ListView field property values. So, we cannot return any additional property values. 
 
Could you please check the above details and get back to us if you need any further assistance on this? 
  
Regards, 
Vinoth Kumar S 


Loader.
Live Chat Icon For mobile
Up arrow icon