473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Best way to dynamically build a page?

I am trying to upgrade a straight ASP project into .NET, but I am new at
..NET, and there seem to be so many different ways to do things. I am new to
..NET and need some guidance as to which approach to take.

My application is to collect answers to an indeterminate number of
questions, which are defined in a database. The definition includes the
question content, type of control and validation for the data. In ASP, the
application called a function for the appropriate type of control to return
the html controls, and the validation details were included as part of the
control names. Validation was all server-side.

I can think of at least 2 ways that (if it works the way I think it does) to
do this in .NET:

1) Create a hard-coded Repeater control, which would include in the item
template all the possible control and validator types, making them all not
visible or not enabled. Then in the OnDataBinding (if this is the right
place), determine which control and validator(s) are needed for each
question, and enable and/or make visible the appropriate ones. I have not
tried this yet (it only just occurred to me), but it would take advantage of
the Repeater to build the page, and it may be easier to program data entry
into the answers database with it.

2) Do it the way the ASP page was built, and create all the controls and
validators dynamically at run-time, adding them to a Placeholder control.
This is what I’ve been working on, but I can’t seem to get any of the
validators working, so I thought maybe this was the wrong approach. And
maybe there is a performance issue with building the controls dynamically,
too.

Can anyone give recommendation on which approach to pursue? Which would be
easier, and whether there are performance issues with either one? Or maybe
there is a completely different way that I have not thought of.

Jul 21 '05 #1
0 1306

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
5
by: Tascien | last post by:
I was able to build an asp page dynamically depending on the question that the user answered through the online wizard... I think i can dynamically also create '.vb' or '.aspx' dynamically...
0
by: Trillium | last post by:
I am trying to upgrade a straight ASP project into .NET, but I am new at ..NET, and there seem to be so many different ways to do things. I am new to ..NET and need some guidance as to which...
3
by: rishi145 | last post by:
i want to build a small cms and wanted to know if it was possible to generate a aspx page dynamically? if so how basically i wan to be able to have a button create new page and name it. thanks...
4
by: sydney.luu | last post by:
Hello, I would greatly appreciate if someone can show me how to dynamically build a Repeater with unknown number of columns at design time. I have looked various threads in this newsgroup,...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
3
by: Ronald S. Cook | last post by:
I would like to put a label (or any control) on a webform all from the code. I.e. something like this: protected void Page_Load(object sender, EventArgs e) { Label TestLabel = new Label();...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.