ASP.NET Podcast Show #102 - ASP.NET AJAX Futures Data Part II - Video and Audio
Original URL: http://aspnetpodcast.com/CS11/blogs/asp.net_podcast/archive/2007/10/04/asp-net-podcast-show-102-asp-net-ajax-futures-data-part-ii-video-and-audio.aspx
Subscribe <-- All the cool kids are doing it!
Download WMV <-- For PC Users.
Download M4V <-- For iTunes/iPod/Zune Users.
Download MP3 <-- For Audio Only Users.
Show Notes:
function pageLoad() {
WebService.GetValues(1, OnCompletion);
}
function OnCompletion(results)
{
var dataOutput = "";
var divOutput = $get("Output");
var strReturn = "<br />";
var dt = ReturnTable(results.tables[0]);
dataOutput += "DataTable: " + strReturn;
for(m in dt)
{
dataOutput += m + strReturn;
}
var dc = dt.get_columns();
dataOutput += "DataColumn: " + strReturn;
for(m in dc[0])
{
dataOutput += m + strReturn;
}
dataOutput += "Random commands: " + strReturn;
dataOutput += "Columns[0].dataType: " + dc[0].get_dataType() + strReturn;
dataOutput += "Columns[1].dataType: " + dc[1].get_dataType() + strReturn;
dataOutput += "Number of Records: " + dt.get_length() + strReturn;
for(i = 0; i<dt.get_length(); i++)
{
var dcc = dt.getRow(i);
dataOutput += "Row:" + i + " Value:" + dcc.getProperty("Name") + strReturn;
}
var dr = dt.createRow();
dr[0] = "Fred Smith";
dr[1] = 5;
dt.add(dr);
dataOutput += "Number of Records: " + dt.get_length() + strReturn;
divOutput.innerHTML = dataOutput;
var dtTest = new Sys.Preview.Data.DataTable();
var dv = new Sys.Preview.Data.DataView();
}
function ReturnTable(dt){
/// <returns type="Sys.Preview.Data.DataTable" />
return Sys.Preview.Data.DataTable.parseFromJson(dt);
}
</script>
<asp:ScriptManager ID="ScriptManager1" runat="server" >
<services>
<asp:servicereference Path="WebService.asmx" />
</services>
<Scripts>
<asp:ScriptReference Name="PreviewScript.js" Assembly="Microsoft.Web.Preview" />
</Scripts>
</asp:ScriptManager>
Warning, Danger Will Robinson, Danger. This is running against CTP level code which will most likely change.