Classic ASP
Classic ASP
JSON PathPrefix Example
Demonstrates the JSON object'sPathPrefix property.
Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
set json = Server.CreateObject("Chilkat.JsonObject")
json.PathPrefix = "company.billing."
success = json.UpdateString("company_name","TechNova Solutions Inc.")
success = json.UpdateString("address_line_1","123 Innovation Drive")
success = json.UpdateString("address_line_2","Suite 450")
success = json.UpdateString("city","Seattle")
success = json.UpdateString("state_province","WA")
success = json.UpdateString("postal_code","98101")
success = json.UpdateString("country","USA")
json.EmitCompact = 0
Response.Write "<pre>" & Server.HTMLEncode( json.Emit()) & "</pre>"
' Result:
' {
' "company": {
' "billing": {
' "company_name": "TechNova Solutions Inc.",
' "address_line_1": "123 Innovation Drive",
' "address_line_2": "Suite 450",
' "city": "Seattle",
' "state_province": "WA",
' "postal_code": "98101",
' "country": "USA"
' }
' }
' }
city = json.StringOf("city")
Response.Write "<pre>" & Server.HTMLEncode( "city = " & city) & "</pre>"
%>
</body>
</html>