In order to let user select a theme, for example defined as values in a DropDowList control, you need to first override PreInit method of the page and then access the control using Request.Form syntax.
protected override void OnPreInit(EventArgs e)
{
this.Master = Request.Form[this.Master.FindControl("DropDownList1").UniqueID];
}
It's important to note that you cannot access the DropDownList control at this stage of the page life cycle. That is why you need to resort to Form collection and FindControl method.
No comments:
Post a Comment