Showing posts with label Json. Show all posts
Showing posts with label Json. Show all posts

Monday, 20 April 2020

India - All State Name in Json format

{
"AN":"Andaman and Nicobar Islands",
"AP":"Andhra Pradesh",
"AR":"Arunachal Pradesh",
"AS":"Assam",
"BR":"Bihar",
"CG":"Chandigarh",
"CH":"Chhattisgarh",
"DN":"Dadra and Nagar Haveli",
"DD":"Daman and Diu",
"DL":"Delhi",
"GA":"Goa",
"GJ":"Gujarat",
"HR":"Haryana",
"HP":"Himachal Pradesh",
"JK":"Jammu and Kashmir",
"JH":"Jharkhand",
"KA":"Karnataka",
"KL":"Kerala",
"LA":"Ladakh",
"LD":"Lakshadweep",
"MP":"Madhya Pradesh",
"MH":"Maharashtra",
"MN":"Manipur",
"ML":"Meghalaya",
"MZ":"Mizoram",
"NL":"Nagaland",
"OR":"Odisha",
"PY":"Puducherry",
"PB":"Punjab",
"RJ":"Rajasthan",
"SK":"Sikkim",
"TN":"Tamil Nadu",
"TS":"Telangana",
"TR":"Tripura",
"UP":"Uttar Pradesh",
"UK":"Uttarakhand",
"WB":"West Bengal"
}

Wednesday, 29 January 2020

How to get list through ajax jquery in c#

Here is simplify method with example please read and practice carefully then definitely you'll do this.

The first method is using get method..

$.ajax({
url:"/Home/GetUserList", /// this is URL  "HOME"- COntroller name, GetUserList-Method Name
type:"GET",   /// define type GET or POST
datatype:"json", /// datatype format
Content-Type:"application/json",
data:{}
success:function(response){
    alert("We got it user list").
}
error: function(response){
alert("we can't found the user list, there is something error");
}
})

Friday, 27 December 2019

How to replacing escape characters from JSON in mvc c#


If the json object is a string, in .Net the escape "\" characters are added,
 should you want to clean up the json string, JObject.Parse({string}) as demonstrated
in the following code snippet cleans up nicely:

var myJsonAsString = "{\"Name\": \"John\", \"LastName\": \"Doe\", \"Age\": 199 }";

var myCleanJsonObject = JObject.Parse(myJsonAsString);
Should give us a clean Json object with the escape characters removed.
{
"Name": "John",
"LastName": "Doe",
"Age": 199
}

redirect to new page from jquery

  function foo(id) { var url = ' @Url . Action ( "Details" , "Branch" , new { id = "__id__" })'...