Click here to Skip to main content
13,256,260 members (49,225 online)
Click here to Skip to main content
Add your own
alternative version


24 bookmarked
Posted 20 Jul 2004

Quick Screen Development in ASP.NET

, 20 Jul 2004
Rate this:
Please Sign up or sign in to vote.
Auto Generate the ASPX page quickly


Developing the screen for various tables has been a boring activity. This is small step towards automating the screen generation for the aspx pages.

Currently this application can generate the aspx tags for SQL Server 2000 table.

The idea is

a. For every column in the table , A Label field is required on the screen.

b. For a natural column in the table, A text box is required on the screen.

c. If the column is not nullable , A required field validator needs to be placed on the screen.

d. For a foreign key, Usually a dropdown list is required.

d. Tab index and Max Length properties also need to be set.

To get the meta data for a table the following procedure is used. It gets the name of the column, Data Type, If it nullable, Size and if it is a foreign key.

Now there are 4 classes in the application. Common.cs has all the common properties. Other classes for the controls are inherited from it. ToString() method is overriden to generate the aspx tag necessary for the control.
Steps to Generate the aspx code.

1. Create the stored procedures provided in your database.

2. Modify the connection information in the Form1.cs file. There are two places you have to modify the connection information . One inside GetTables() method and another inside ProcessTable(string TableName).

3. Execute the project. In the Window The combo shows the list of tables available. Enter the name of the table inside the text box and click the generate button.

4. Copy the code from the textbox below and paste inside the <form></form> tags inside your aspx page.

5. There you go.....

Currently this generates a label for every column, Text or Combo box depending on weather it is a table column or a foreign key, generates a required field validator for not nullable fields,sets the tab order and max length properties.

Let me know if there are other methods to generate aspx pages.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Balachandar Ganesan
Web Developer
United States United States
Balachandar Ganesan has been working in CGI India for the last 6 years. ASP.NET, SQL Server 2000, Crystal Reports, Database Performance tuning, ETL, Actuate, Cobol, CICS,DB2, Easytrieve, Flash, PaintShop Pro , SoundForge are few of the various technologies with which he has worked.

He is known for ability to generate applications with "just good enough" features in a short time.

He has written whitepapers on Software development process improvement as well.

Image, Video and Audio editing are his hobbies. He is also the editor of his company newsletter, Manager of cricket and volleyball teams, Vice-President of Toastmasters club.

You may also be interested in...


Comments and Discussions

GeneralSource Code Pin
damonr26-Jul-04 6:00
memberdamonr26-Jul-04 6:00 
GeneralCodesmith Pin
Steven Campbell22-Jul-04 4:47
memberSteven Campbell22-Jul-04 4:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171114.1 | Last Updated 21 Jul 2004
Article Copyright 2004 by Balachandar Ganesan
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid