Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > asp.net webcontrols > june 2004 >

asp.net webcontrols : Replacing a control dymamically (to use a webform as a template)


Rocky Moore
6/22/2004 12:07:43 AM

[quoted text, click to view]

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.

--
Rocky Moore
www.HintsAndTips.com - ~ Developer Tips Wanted ~
www.RJSoft.com/Products/RJContentPanel/ - Free web user content control!

Victor Garcia Aprea [MVP]
6/22/2004 12:10:57 AM
Hi jorge,

Any source code illustrating what you're doing would really help in
understanding what may be wrong.

It seems like you're after page templating in which case I highly recommend
you to take a look at Master Pages and its derivatives[1]

[1] http://weblogs.asp.net/vga/archive/2003/05/20/ExtendingMasterPages.aspx

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx

[quoted text, click to view]

jorge
6/22/2004 12:37:00 AM
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

jorge
6/22/2004 1:11:31 AM
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

[quoted text, click to view]

AddThis Social Bookmark Button