473,387 Members | 1,619 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,387 software developers and data experts.

Dynamic control creation design issue

Hi!

I have been wondering about a design issue for some time now and hope
someone can help sort this one out for me.

Say you have to create some webcontrols dynamically. Each controls creation
is dependent on another’s selected value. That is, you can’t create control B
if you don’t know the value of control A. There is no problem this far. I’ve
done some testing and if I always create the control in Page_Init, ASP.NET
has filled its value property for me when I’m in Page_Load. Thus I have the
information I need in order to create control B. We can consider my controls
as a custom webcontrols that is dependent of some value in the constructor in
order to be created properly.

So, if I am to create a third control, control C, that is dependent of the
value of control B, I now have to this in Page_PreRender. Control B isn’t
created before Page_Load, and its value property therefore isn’t set until
the next event occurs in the event stages, which as far as I know Is
Page_PreRender.

I actually was forced to do all of this in a recent project, and made me
wondering if I’m doing this correctly, because if I am, what happens if I am
to create a fourth control, control D, that is dependent of control C created
in Page_PreRender? As far as I know there are only Page_Init, Page_Load and
Page_PreRender, and if a control is created in one of them, its value isn’t
set until the next of these events occurs. In former projects, I used to get
the values directly from the Request.Form collection. This way all these
problems are solved, but it just doesn’t seem to be the .NET way to do it. :)

I would be glad if you want to share your thoughts about this one, am I
missing some basics here or is there simply no .NET-ish way of doing this?

Thanks
/Paul
Feb 21 '06 #1
0 1115

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

Similar topics

17
by: e-mid | last post by:
i have a user control (say myUserControl) that inherits panel, i create some textboxes on myUserControl dynamically, then i create some myUserControls on the form dynamically with a loop . of...
6
by: MikeY | last post by:
Hi Everyone, Does anyone know where I can get my hands on a sample with source code of a simple dynamic button control in C# Windows form. I am looking for a sample that uses a class library...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
2
by: Dave Williamson | last post by:
When a ASPX page is created with dynamic controls based on what the user is doing the programmer must recreate the dynamic controls again on PostBack in the Page_Load so that it's events are wired...
1
by: Homam | last post by:
So I have a composite paging control that shoulld be positioned on the page like this: PagNav ResultSetDisplay PagNav I know that I can't resuse the PagNav more than once in the form, so I...
3
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
0
by: Pascal Costanza | last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab,...
7
by: msdev | last post by:
Hello, I am creating my own webbrowser to learn VB .Net. I am stuck on an issue with regards to dynamically-created controls, in this case tabs on a tabcontrol and webbrowsers created within...
1
by: cdmsenthil | last post by:
I have an Infragistics UltrawebGrid . Each Row in the grid is attached to a context menu using Infragistics CSOM Upon click on the menu, I am creating an Iframe dynamically which points to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.