473,395 Members | 2,192 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,395 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 1305

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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.