Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 27th, 2004, 09:33 PM
Registered User
 
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Create Controls at Runtime

Hi All,

I'm using MsSQL2000. How can I generate an aspx with certain <asp:ControlName ..../> based on my SQL Data at runtime ?

For example: I have a table called Students.

StudentID Title1 DispControl1 Title1 DispControl2
A0001 CourseName Listbox Comments textbox
B0003 DateofBirth Calendar ************ DropDownList

When Student A0001 login (login.aspx), they will see CourseName with its Listbox and Comments with textbox in SCREEN.ASPX

When Student B0003 login (login.aspx), they can select DateofBirth from Calendat and ************ from the dropDownList in SCREEN.ASPX

Any possibility to write ONE aspx ie SCREEN.ASPX to display different StudentID data ? I hope that I do not need to hardcoded many many aspx to cater this.

Any advice is appreciated. Thanks in advance!!


 
Old July 28th, 2004, 07:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Well, you need to determine what are the differences between Student A0001 and B0003 (with what options are shown: CourseName, DateofBirth), to determine whether you can pickup the difference through code. Seeing A0001 and B0003 I would have to say that you would check the first letter of the user to pickup the difference, then output the appropriate info.

I use two panels to switch the appropriate content. If Student A.. logins in, then show the Listbox and textbox in panel1, otherwise, show the calendar and dropdownlist in panel2.

Brian
 
Old July 30th, 2004, 10:21 PM
Registered User
 
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!!! I'll try it out.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Controls At Runtime with MFC. burtlo Visual C++ 2005 2 October 13th, 2007 06:36 AM
Controls at runtime ITGeek ASP.NET 1.0 and 1.1 Basics 4 July 11th, 2007 05:23 AM
Add Runtime Controls dpkbahuguna Beginning VB 6 2 December 7th, 2006 08:55 AM
Load User Controls at Runtime Duncan VB.NET 3 November 4th, 2005 07:05 PM
How to create controls at runtime ? kishore_peddi C# 1 November 3rd, 2003 09:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.