Home arrow ASP.NET arrow Page 4 - An Object Driven Interface with .Net
ASP.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
TABLE OF CONTENTS:
  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
SEARCH DEVARTICLES

An Object Driven Interface with .Net - Part 4: Using our Interface Generator
(Page 4 of 4 )

For this we will create a simple Web project to use our interface generator.

Using our interface generator is really simple; we create a Web project and add a Placeholder called PropertyHolder to the page. We the create an instance of our business object, once we have our business object we create an instance of our interface generator passing it our business object in the .ctor., the Interface Generator is declared withevents so that we can handle the ValuesUpdated event.


Dim WithEvents Generator As Wizard.Control.Prototype.InterfaceGenerator

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
TestObject = New Customer
Generator = New Wizard.Control.Prototype.InterfaceGenerator(TestObject)
PropertyHolder.Controls.Add(Generator)
If IsPostBack Then
PropertyHolder.Visible = False
End If
End Sub

For the test when the event is triggered we display the values to the user.

Private Sub Generator_ValuesUpdated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Generator.ValuesUpdated
TestObject = Generator.WizardObject
Response.Write("<P>The Following Properties Values now exist in the Object:</P>")
Response.Write(TestObject.Active & "<BR>")
Response.Write(TestObject.Address1 & "<BR>")
Response.Write(TestObject.Address2 & "<BR>")
Response.Write(TestObject.City & "<BR>")
Response.Write(TestObject.Contact & "<BR>")
Response.Write(TestObject.CreditLimit & "<BR>")
Response.Write(TestObject.Number & "<BR>")
Response.Write(TestObject.Phone & "<BR>")
Response.Write(TestObject.Postal & "<BR>")
End Sub

Now that was cool wasn’t it!


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
ASP.NET ARTICLES

- 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 
Support 

Developer Shed Affiliates

 




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