I think ... you should use two-way binding to your HTML code ... therefore, as soon as your client side changes, you will end up in your costume js file.
check here for js knockout.
Get JS link
and in C # use the code: $ ("# urlhidden"). val () OR Document.GetElemenyByID ("# urlhidden"). val ().
here you will get the value of the array / list or text field
Use json with Ko
create a new view model for js knockout, which you will learn about in the link above.
and create a json call like:
self.LoadMAS_Client = function () { try { var params = { "clientID": ClientId }; $.ajax({ type: "POST", url: "http://" + ServerString + "/Services/LogisticsAppSuite-Services-Web-Services-MasClientService.svc/Json/GetAllLevelSubClients", contentType: 'application/json', data: JSON.stringify(params), dataType: 'json', async: false, cache: false, success: function (response) {
=============================== New update ============== ===== ========================= I think ... how can you do this ... get the data in xml format in C # code and is hidden in a string json ... check below code // Convert XML node contained in xml string to JSON string
XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); string jsonText = JsonConvert.SerializeXmlNode(doc);
Jignesh.Raj
source share