Loading aspx/ascx

Discussion in 'ASP .Net' started by =?Utf-8?B?TWljaGVs?=, May 23, 2005.

  1. Hi folks,

    Little questions:

    I need to load different aspx and ascx files, depending on user settings.
    The files are all identically (the pages contains the same asp components) ,
    except some layout elements can differ (html tables, images, ... can differ.

    Is there a way to overwrite the aspx content from before rendering? (Would
    be somehting like loading another template in ASP.NET 2.0)
     
    =?Utf-8?B?TWljaGVs?=, May 23, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?TWljaGVs?=

    Brock Allen Guest

    > I need to load different aspx and ascx files, depending on user
    > settings. The files are all identically (the pages contains the same
    > asp components) , except some layout elements can differ (html tables,
    > images, ... can differ.


    Sure, this is not a problem. Dynamically create the controls (or call LoadControl)
    and then add them into the page at the right place by calling Controls.Add().
    Also, recreate those controls upon every postback - that's an important step.

    > Is there a way to overwrite the aspx content from before rendering?
    > (Would be somehting like loading another template in ASP.NET 2.0)


    You can always manipulate the control tree prior to Render and that's how
    you control the layout. It's the same as adding controls described above.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen
     
    Brock Allen, May 23, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?TWljaGVs?=

    MW de Jager Guest

    Have you tried panels. Create a different panel for each user, and maybe
    another panel with controls that will always be visible. Make all the other
    panels invisible. On page load, make only the panels visible that are
    relevant to your user.

    My 2c
    MW

    "Brock Allen" <> wrote in message
    news:...
    >> I need to load different aspx and ascx files, depending on user
    >> settings. The files are all identically (the pages contains the same
    >> asp components) , except some layout elements can differ (html tables,
    >> images, ... can differ.

    >
    > Sure, this is not a problem. Dynamically create the controls (or call
    > LoadControl) and then add them into the page at the right place by calling
    > Controls.Add(). Also, recreate those controls upon every postback - that's
    > an important step.
    >
    >> Is there a way to overwrite the aspx content from before rendering?
    >> (Would be somehting like loading another template in ASP.NET 2.0)

    >
    > You can always manipulate the control tree prior to Render and that's how
    > you control the layout. It's the same as adding controls described above.
    >
    > -Brock
    > DevelopMentor
    > http://staff.develop.com/ballen
    >
    >
    >
     
    MW de Jager, May 23, 2005
    #3
    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. Quentin
    Replies:
    1
    Views:
    489
    Quentin
    Jul 29, 2003
  2. Jason Shohet
    Replies:
    1
    Views:
    485
    Kevin Spencer
    Nov 10, 2003
  3. Holger (David) Wagner
    Replies:
    2
    Views:
    1,944
    Holger (David) Wagner
    Jul 3, 2004
  4. Joe
    Replies:
    1
    Views:
    374
    Jeffrey Tan[MSFT]
    Feb 16, 2004
  5. Replies:
    2
    Views:
    539
Loading...

Share This Page