Replacing a control dymamically (to use a webform as a template)

J

jorge

Hi all,

I have to replace a bunch of controls dynamically (TextBoxes, DropDowns,
etc).

Any way to do this? The 'template' pages are made on asp.net with tables
(not runat=server) and asp:textboxes, etc.

So I need to do a loop on the controls of the webform, but alas! they are
read only. I could do it directly on the template webform, that would be OK,
but not as good, but I cannot:

myTextBoxInMyWebFormWithFormatting = myDynamicallyCreatedTextBoxWithValues;

Ideas?
/ jorge
 
J

jorge

I suppose its dynamically not dymamically.

Oh, and it is not only the value, there are a bunch of events attached to
the textbox and autopostback mapped to an object model, and dynamic
validation. That is why it is quite important that i get it right

/ jorge
 
R

Rocky Moore

jorge said:
Hi all,

I have to replace a bunch of controls dynamically (TextBoxes, DropDowns,
etc).

Any way to do this? The 'template' pages are made on asp.net with tables
(not runat=server) and asp:textboxes, etc.

So I need to do a loop on the controls of the webform, but alas! they are
read only. I could do it directly on the template webform, that would be OK,
but not as good, but I cannot:

myTextBoxInMyWebFormWithFormatting = myDynamicallyCreatedTextBoxWithValues;

Ideas?
/ jorge

You might take a look at my web control below. It allows you to easily swap
in and out user controls. Works really well and you still have full control
over you code behind.

I use this method (as do others) as a master type template style.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top