Archive for February, 2009

*) note : we use .netCharting as component/control in this article


This document describes how to add the .netCHARTING control to various versions of Visual Studio toolbox.

Visual Studio 2002 & 2003:

  • Right-Click on the toolbox > Add/Remove Items
  • Select the .net Framework Components tab
  • If the server version is installed, the component will be listed in the list box. Otherwise, click browse and select the .netCHARTING dll.
  • Click Ok to finish.
  If the error “The format of the file ‘dotnetcharting’ is invalid.” occurs. This means the dll being added is a .net 2.0 assembly. To resolve this issue, the .net 1.x version of the bundle must be downloaded and used instead.


Visual Studio 2005, 2008 & Express editions.

  • Right-Click on the toolbox > Choose Items
  • Select the .net Framework Components tab
  • If the server version is installed, the component will be listed in this tab. Otherwise, click browse and select the .netCHARTING dll.
  • Click Ok to finish. 

    Web Matrix

    • Select “Custom Controls” tab of the toolbox.
    • Right-Click on the custom controls tab and select “Add Local Toolbox Components…”
    • Click “Browse…”
    • Navigate to the location of the dotnetcharting.dll file, select it and click ok.
    • Finally click ok at the “Select Components” popup.
    • When the “Install to GAC” popup appears, click no.
  • Advertisements

    Read Full Post »

    Build Your Own ASP.NET Server Control Component
    by alfred_ng@hotvoice.com

    Here will deliver a simple tutorial guide you how to build a component using VB.NET, and the steps using it with ASP.NET Web Page.

    This component will generate the bullet or numbering beside your list.

    Below is the coding of the component

    Step1: Copy the code below save it as “ShowList.vb” filename.

    ================== Code Listing: ShowList.vb ========================

    Imports System
    Imports System.Web
    Imports System.Web.UI
    Imports System.Collections

    Namespace listControl

    Public Class ShowList: Inherits Control

    Private _dataSource As IEnumerable

    Public Property DataSource As IEnumerable

    Return _dataSource
    End Get

    _dataSource = Value
    End Set
    End Property

    Public Title As String
    Public Format As String

    Protected Overrides Sub OnDataBinding (e As EventArgs)

    Dim DataEnum As IEnumerator
    Dim ltlLiteral As LiteralControl
    Dim lstBeginFormatTag As String
    Dim lstEndFormatTag As String

    Controls.Add(New LiteralControl(“” & Title & ““))

    Select Case Format.ToLower()
    Case “number”
    lstBeginFormatTag = “

      lstEndFormatTag = “

    Case “bullet”
    lstBeginFormatTag = “

      lstEndFormatTag = “

    End Select

    If Format.ToLower() “number” AND Format.ToLower() “bullet” Then
    Controls.Add(New LiteralControl(“
    ” _
    & “Error Message: Undefined “”Format”” Property, either ” _
    & “””number”” or “”bullet””

    If Not DataSource Is Nothing
    DataEnum = DataSource.GetEnumerator()
    Controls.Add(New LiteralControl(lstBeginFormatTag))

    While (DataEnum.MoveNext())
    ltlLiteral = New LiteralControl (DataEnum.Current.ToString())

    Controls.Add(New LiteralControl(“

  • “))
    Controls.Add(New LiteralControl(“
  • “))
    End While

    Controls.Add(New LiteralControl(lstEndFormatTag))
    Controls.Add(New LiteralControl(“
    ” _
    & “Data Not Found!

    End If
    End If
    End Sub

    End Class

    End Namespace

    ================== End of Code Listing ==============================

    Step2: Compile and locate it at your web application root\bin folder.

    vbc /t:library /r:System.dll,System.Web.dll ShowList.dll

    Step3: Implement into your ASP.NET page, copy it and save it as “ListControl.aspx”.

    ================== Code Listing: ListControl.aspx ===================

    Sub Page_Load

    Dim theList As ArrayList

    theList = New ArrayList
    theList.Add (“Expresso”)
    theList.Add (“Cappurino”)
    theList.Add (“Coffee”)
    theList.Add (“Mocha”)

    dbBound.DataSource = theList

    End Sub

    ListControl Demonstration

    Build Your Own Bullet and Numbering Control Component

    ================== End of Code Listing ==============================
    In order to use the control, remember that locate the “ShowList.dll” file which is just generated into the web application root\bin folder. Inside your .aspx page, you need to attach this code on top

    Inside the content, you need to attach the code below to using the control.

    Description: Initially the Page_Load will bind the data into the control. You may bind the data with the database. For the “Format” property you can use either “bullet” or “number” to display your list. The “Title” property, it is just a title for the listing and in “BOLD” format.

    Thanks for reading and try it out. Any suggestion or recommendation about this control are welcome reply to me.

    source : http://www.asp101.com/articles/misc/usercontrol/default.asp

    Read Full Post »