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

Discussion in 'ASP .Net Web Controls' started by jorge, Jun 22, 2004.

  1. jorge

    jorge Guest

    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, Jun 22, 2004
    #1
    1. Advertising

  2. jorge

    jorge Guest

    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
    >
    >
    jorge, Jun 22, 2004
    #2
    1. Advertising

  3. 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

    "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
    >
    >
    Victor Garcia Aprea [MVP], Jun 22, 2004
    #3
  4. jorge

    Rocky Moore Guest

    "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!
    Rocky Moore, Jun 22, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. titof
    Replies:
    0
    Views:
    490
    titof
    Jul 24, 2003
  2. timmso
    Replies:
    1
    Views:
    470
    Alex Papadimoulis
    Dec 12, 2003
  3. =?Utf-8?B?bXN1aw==?=

    Using one webform to set a value on another webform

    =?Utf-8?B?bXN1aw==?=, Jul 12, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    446
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 12, 2006
  4. jorge
    Replies:
    3
    Views:
    129
    Rocky Moore
    Jun 22, 2004
  5. Rob Meade

    Replacing - and not Replacing...

    Rob Meade, Apr 5, 2005, in forum: ASP General
    Replies:
    5
    Views:
    261
    Chris Hohmann
    Apr 11, 2005
Loading...

Share This Page