Home arrow ASP.NET arrow Page 2 - An Object Driven Interface with .Net

An Object Driven Interface with .Net

Using .Net, Paul will demonstrate how to generate an object driven interface. A rich source of support material is included with this article so you can start building interfaces today.

Author Info:
By: Paul Stevens
Rating: 5 stars5 stars5 stars5 stars5 stars / 42
August 24, 2003
  1. · An Object Driven Interface with .Net
  2. · Part 2: Creating our Business Object
  3. · Part 3: The Interface Generator
  4. · Part 4: Using our Interface Generator

print this article

An Object Driven Interface with .Net - Part 2: Creating our Business Object
(Page 2 of 4 )


In this part, we are going to use the base and attribute classes that we created in the previous part to create a business object that we can use to generate our interface. We will base the business object on a simple customer object with Customer information, Contact details and an Address.

First we will create a very simple business object called Customer, in customer we will have a number of properties that make up the customer object.

Imports Web.Wizards.Base
Imports System.Web.UI
Public Class Customer
Inherits WizardBase
Private lNumber As String
Private lName As String
Private lContact As String
Private lPhone As String
Private lAddress1 As String
Private lAddress2 As String
Private lCity As String
Private lPostal As String
Private lActive As Boolean
Public Sub New()
CreateList("Code1", "Code2", "Code3")
End Sub
End Class

The class inherits from WizardBase therefore the class will automatically contain all the methods and properties that exist in WizardBase, in Sub New, we call the method Createlist in the BaseClass to create a List that we will later use when we generate our interface, in order for us to expose our Variables so that we can get get data from our user we create properties.

<WizardAttributes("Name", GetType(WebControls.TextBox), _
Helptext:="The Customers Name", _
SectionName:="Details")> _
Public Property Name() As String
Return lName
End Get
Set(ByVal Value As String)
lName = Value
End Set
End Property

The property declaration declares a Public Read/Write Property Called Name that is used to access the Private field lName, in the code above we also use the Custom attribute class we created “WizardAttributes”, with the custom attribute we specify that the label should state that the field is called Name, that a System.Web.UI.Webcontrols.TextBox should be used to render the Property, that when the user selects the Property Help should display “The Customers Name”, and that the property should fall under a section called “Details” on the property grid.

blog comments powered by Disqus

- How Caching Means More Ca-ching, Part 2
- How Caching Means More Ca-ching, Part 1
- Reading a Delimited File Using ASP.Net and V...
- What is .Net and Where is ASP.NET?
- An Object Driven Interface with .Net
- Create Your Own Guestbook In ASP.NET
- HTTP File Download Without User Interaction ...
- Dynamically Using Methods in ASP.NET
- Changing the Page Size Interactively in a Da...
- XML Serialization in ASP.NET
- Using Objects in ASP.NET: Part 1/2
- IE Web Controls in VB.NET
- Class Frameworks in VB .NET
- Cryptographic Objects in C#: Part 1
- Sample Chapter: Pure ASP.Net

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials