Newbie - Can you point me in the right direction.

  • Thread starter Thread starter james
  • Start date Start date
J

james

I am trying to put together a simple site where the user can select the page
layout from a set of templates.

The templates will be in the form of 3 blocks of code: header, navigation
and footer

I have tried using user controls and calling them by using

<%@ Register TagPrefix="uc1" TagName="Header" Src="header.ascx" %>

however i cant figure out a wat to reference the control dynamicaly i.e

<%@ Register TagPrefix="uc1" TagName="Header" Src= myString %>

Is there any way of dynamicaly referencing the user control file name

Is this the best way of trying to acheive this?

Thanks in advance

J
 
Control c = Page.LoadControl("~/YourControl.ascx");

to load and create the control. then you need to add it under some other
control in your form -- like a <asp:PlaceHolder>

myPlaceHolder.Controls.Add(c);

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
Back
Top