Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Replacing a control dymamically (to use a webform as a template)

Reply
Thread Tools

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

 
 
jorge
Guest
Posts: n/a
 
      06-21-2004
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


 
Reply With Quote
 
 
 
 
jorge
Guest
Posts: n/a
 
      06-22-2004
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

"jorge" <> wrote in message
news:eCppfh%...
> 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
>
>



 
Reply With Quote
 
 
 
 
Victor Garcia Aprea [MVP]
Guest
Posts: n/a
 
      06-22-2004
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/2...sterPages.aspx

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

"jorge" <> wrote in message
news:eCppfh%...
> 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
>
>



 
Reply With Quote
 
Rocky Moore
Guest
Posts: n/a
 
      06-22-2004

"jorge" <> wrote in message
news:eCppfh#...
> 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.

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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using one webform to set a value on another webform =?Utf-8?B?bXN1aw==?= ASP .Net 1 07-12-2006 07:23 PM
Replacing - and not Replacing... Rob Meade ASP General 5 04-11-2005 06:49 PM
Replacing a control dymamically (to use a webform as a template) jorge ASP .Net Building Controls 3 06-22-2004 07:07 AM
no code in webform using vs.net, but in webform using notepad timmso ASP .Net 1 12-12-2003 04:30 PM
Including WebForm Image Control in a Webform Table Control titof ASP .Net 0 07-24-2003 01:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57