NetCharts® Server: ASP.NET Toolkit getTable Example using Visual Basic
This example shows how to utilize the NetCharts Server ASP.NET Toolkit to add an HTML table generated by NetCharts Server to an ASPX page using Visual Basic.
Web Form
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="nswebtable.aspx.vb" Inherits="vbtoolkitexample.nswebtable"%>
<%@ Register TagPrefix="ns" Namespace="NetChartsServer" Assembly="NetChartsServer" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>NetCharts Server .NET Toolkit - NSWebTable Control Example</title>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<link REL="stylesheet" HREF="styles.css" TYPE="text/css">
</HEAD>
<body>
<p align=center><a href="http://www.visualmining.com" target="vmwindow"><img border=0 src="images/start-page-illo2.jpg"></a></p>
<P><B>Information:</B><br>
The <I><B>NSWebTable</B></I> control is a custom control that developers can"drag" onto a WebForm to represent a table from <STRONG>NetCharts Server</STRONG>.
By setting the properties of the <i><B>NSWebTable</B></I> control a developer can quickly integrate a table without the need for an ASP Literal control or coding. Table parameters can be sent via the <i>Variables</i> property of the <I><B>NSWebTable</B></I> control. If more control over the table is needed, consider using the <i>getTable</i> API function. Click <a href="getTable.aspx">
here</a> for a example.</P>
<P><b>Example:</b><br>
<ns:NSWebTable id="NSWebTable1" runat="server" Width="421px" Project="Examples/Tables" TableFile="ColumnStyles.tbl"></ns:NSWebTable>
</P>
<p><b>Source Code:</b><br>
<span class="code">Dim hashTable As Hashtable = NSWebTable1.Variables<br>
If (hashTable Is Nothing) Then<br>
hashTable = New Hashtable<br>
End If<br>
hashTable.Add("tableCaption", "Example Table Using the NSWebTable Control")<br>
NSWebTable1.Variables = hashTable</span></p>
</body>
</HTML>
Source Code
Public Class nswebtable
Inherits System.Web.UI.Page#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()End Sub
Protected WithEvents NSWebTable1 As NetChartsServer.NSWebTable'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.ObjectPrivate Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim hashTable As Hashtable = NSWebTable1.Variables
If (hashTable Is Nothing) Then
hashTable = New Hashtable
End If
hashTable.Add("tableCaption", "Example Table Using the NSWebTable Control")
NSWebTable1.Variables = hashTable
End SubEnd Class
![]()



