Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# tigermain 7/17/2007 2:29 PM (edited 7/17/2007 2:31 PM)
If you make this minor change to the content regions you can have user controls in your template files which have adminable content regions:

Change to file Web\UI\Template\BaseTemplate.cs line 59:
		public Hashtable Containers
		{
			get 
			{
				Hashtable tbl = new Hashtable();
				foreach (Control ctrl in this.Form.Controls)
				{
                    if (ctrl is PlaceHolder)
                    {
                        tbl.Add(ctrl.ID, ctrl);
                    }
                    else if (ctrl is UserControl)
                    {
                        foreach (Control ctrl2 in ctrl.Controls)
                        {
                            if (ctrl2 is PlaceHolder)
                                tbl.Add(ctrl2.ID, ctrl2);
                        }
                    }
				}
				return tbl;
			}
		}

Am still testing will post here if I find any issues
# tigermain 7/17/2007 2:30 PM
N.B. This only works for first child usercontrols, you could extend the method to look through reciprical user controls but I didnt need that so stopped there