Database Reference
In-Depth Information
grandChild3.data.DOLLARcolor = "#B2ABD2";
grandChild3.data.image = "";
allChild.children.Add(grandChild);
allChild.children.Add(grandChild2);
allChild.children.Add(grandChild3);
tmJSON.children = new List<Child>();
tmJSON.children.Add(allChild);
tmJSON.data = new Data3();
}
public string serialize()
{
JavaScriptSerializer js = new JavaScriptSerializer();
return js.Serialize(tmJSON);
}
}
}
This code hard codes the values for the treemap—in the samples for this
chapter, a data-driven layer that returns the same data is provided. Finally,
go back to OECD.svc (you created this at the beginning of the example; just
double-click to open it). Add the following using statement at the top:
using OECD.JSONSerialization;
then replace:
return (new Response() { tmString = "basic Response" });
with:
Serial s = new Serial();
string sTM = s.serialize().Replace("DOLLAR", "$");
return (new Response() { tmString = sTM });
This will call the class you just created to retrieve the data, and replace the
placeholders with the $ symbols. Press Ctrl-Shift-B to rebuild.
Finally, right-click the project OECDWebSvc and choose Publish. You see the
screen shown in Figure 9-14. You may need to create a new profile if Profile
1 does not appear in your drop-down—do this simply by entering a name in
the text box, and then entering the settings
Set the URL to the website you created earlier, set the Site/Application to
OECD, tick the Mark as IIS application on destination check box and click the
publish button.
Search WWH ::




Custom Search