You must Sign In to post a response.
  • Category: ASP.NET

    How I able to take individual field and take entire data from url which contain json input

    I came up with situation where I will give my aspx page to serverside ppl,they append json data to my page.I want to take that json data and insert into table1.Suppose json data contain 10 field,I want to take 5 out of them and insert into table2.

    Here is my url.

    http://domainname.com/pagename.aspx?{'data':'{"Location": "xxxxxx","Apikey": "xxxxxxxxxxxxx",
    "Skill": "xxxxxx","PhoneName": "xxxxxxxxxx","Type": "xxxxxxx","Address":"xxxx","Pincode":"xxxx"
    }'}
  • #768752
    Hai Pinky,
    You need to first get the Json part of the data and kip the other part using Split function. Split the whole string from the '?' to get the second part as the JSON result.
    Once you get the Json part, you need to stringify the Json data to get the string key values and then split it with ':'.
    By this way, you can get the desired results for all your key with the values.
    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #768765
    Thanks Pawan for ur help.Here I am giving url to client like http://domainname.com/pagename.aspx.On same page it will append json data to it.On same page I want to catch json data.I am not using other page to fetch data.If other page,I will able to do it.But on the same page how to do it.Normally we use querystring to fetch data like
    http://domainname.com/pagename.aspx?page=page1&number=3 but data is not key value pair.It is in json format.I will take entire url of current page.If I get entire url string on same page like
    http://domainname.com/pagename.aspx?{'data':'{"Location": "xxxxxx","Apikey": "xxxxxxxxxxxxx",
    "Skill": "xxxxxx","PhoneName": "xxxxxxxxxx","Type": "xxxxxxx","Address":"xxxx","Pincode":"xxxx"
    }'} Then only I am able to split.How will I get that?


  • Sign In to post your comments