Loading aspx/ascx

G

Guest

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)
 
B

Brock Allen

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

MW de Jager

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
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top