Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Get the ko.observable array to the server side in asp.net

$
0
0

I have the ajax call below which will do a POST to give me the below data

self.present_conditions = "[{"Township":"12","Range":"21","Section":"111","Acres":"19"}]"

var data = ko.toJSON(self.present_conditions());
    $.ajax({
        type:"POST",
        url:"/Home/PBHEP",
        contentType:"application/json; charset=utf-8",
        data: data}).done(function(){
        alert("Data Saved");});

I want to receive this data on my server side at the action result below but I always end up with null value.

[HttpPost]publicActionResult PBHEP(string[] data){returnView();}

What should I do here to get that array onto the server side.

Thank you in advance.


sudhansh


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>