i have made a user control of RadioButtonList to select the diffrent Themes and accessing all the themes from App_Theme folder and binding to the RadioButtonList like this
if (Globals.ThemesSelectorID.Length == 0)
Globals.ThemesSelectorID = rbl.UniqueID; rbl.DataSource = Helpers.GetThemes();
rbl.DataBind();
rbl.SelectedValue =
this.Page.Theme;
it is binding fine but the problem comes when i run the page and select the different Themes from RadioButtonList it does no apply that theme, only page posts back.
and this is my BasePage Class
public
class BasePage : System.Web.UI.Page
{
protected override void OnPreInit(EventArgs e)
{
string id = Globals.ThemesSelectorID;if (id.Length > 0)
{
// if this is a postback caused by the theme selectors RadioButtonListdownlist,
// retrieve the selected theme and unse it for the current page requestif (this.Request.Form["__EVENTTARGET"] == id &&!string.IsNullOrEmpty(this.Request.Form[id]))
{
this.Theme = this.Request.Form[id];this.Session["CurrentTheme"] = this.Theme;
}
else
{
if (this.Session["CurrentTheme"] != null)this.Theme = this.Session["CurrentTheme"].ToString();
}
}
base.OnPreInit(e);
}
}
how i can resolve this