Assign themes programmatically - Master Pages
-
Hi. currently i m using asp.net 2005 (2.0 framework). i have created 3 themes and i let the user to change the theme (using dropdownbox). below code i have used.
const string _themeListIDKey = "_themeListIDKey";
protected void Page_PreInit(object sender, EventArgs e)
{
if (IsPostBack)
{
string uniqueID = Request[_themeListIDKey];if (uniqueID != null && Request\[uniqueID\] != null) { Theme = Request\[uniqueID\]; Session\["SelectedTheme"\] = Theme; } } }
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterHiddenField(_themeListIDKey, ((DropDownList)(this.Master.FindControl("DropDownList1"))).UniqueID);
}but when i create a skin for gridview onload its not working. when i change another theme and again i come to the current there through dropdown, then only its applying. help me plz.... - Karan
-
Hi. currently i m using asp.net 2005 (2.0 framework). i have created 3 themes and i let the user to change the theme (using dropdownbox). below code i have used.
const string _themeListIDKey = "_themeListIDKey";
protected void Page_PreInit(object sender, EventArgs e)
{
if (IsPostBack)
{
string uniqueID = Request[_themeListIDKey];if (uniqueID != null && Request\[uniqueID\] != null) { Theme = Request\[uniqueID\]; Session\["SelectedTheme"\] = Theme; } } }
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterHiddenField(_themeListIDKey, ((DropDownList)(this.Master.FindControl("DropDownList1"))).UniqueID);
}but when i create a skin for gridview onload its not working. when i change another theme and again i come to the current there through dropdown, then only its applying. help me plz.... - Karan
Karan_TN wrote:
when i create a skin for gridview onload its not working
Do you mean Page_Load or onload in the client ? Show the code that fails.
-
Hi. currently i m using asp.net 2005 (2.0 framework). i have created 3 themes and i let the user to change the theme (using dropdownbox). below code i have used.
const string _themeListIDKey = "_themeListIDKey";
protected void Page_PreInit(object sender, EventArgs e)
{
if (IsPostBack)
{
string uniqueID = Request[_themeListIDKey];if (uniqueID != null && Request\[uniqueID\] != null) { Theme = Request\[uniqueID\]; Session\["SelectedTheme"\] = Theme; } } }
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterHiddenField(_themeListIDKey, ((DropDownList)(this.Master.FindControl("DropDownList1"))).UniqueID);
}but when i create a skin for gridview onload its not working. when i change another theme and again i come to the current there through dropdown, then only its applying. help me plz.... - Karan
Where did you applied the Themes in page ??
Cheers ! Abhijit Jana | MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
-
Karan_TN wrote:
when i create a skin for gridview onload its not working
Do you mean Page_Load or onload in the client ? Show the code that fails.
-
Where did you applied the Themes in page ??
Cheers ! Abhijit Jana | MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
-
i applied this coding in all pages. and the dropdown control is in master page (content area)
Karan_TN wrote:
i applied this coding in all pages
Where did you used Page.Theme = currentTheme ?? Don't Apply the theme to all pages. Try to use
HTTPHanlder
for do the job automatically for you.Cheers ! Abhijit Jana | MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
-
Hi. currently i m using asp.net 2005 (2.0 framework). i have created 3 themes and i let the user to change the theme (using dropdownbox). below code i have used.
const string _themeListIDKey = "_themeListIDKey";
protected void Page_PreInit(object sender, EventArgs e)
{
if (IsPostBack)
{
string uniqueID = Request[_themeListIDKey];if (uniqueID != null && Request\[uniqueID\] != null) { Theme = Request\[uniqueID\]; Session\["SelectedTheme"\] = Theme; } } }
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterHiddenField(_themeListIDKey, ((DropDownList)(this.Master.FindControl("DropDownList1"))).UniqueID);
}but when i create a skin for gridview onload its not working. when i change another theme and again i come to the current there through dropdown, then only its applying. help me plz.... - Karan
-
Hi. currently i m using asp.net 2005 (2.0 framework). i have created 3 themes and i let the user to change the theme (using dropdownbox). below code i have used.
const string _themeListIDKey = "_themeListIDKey";
protected void Page_PreInit(object sender, EventArgs e)
{
if (IsPostBack)
{
string uniqueID = Request[_themeListIDKey];if (uniqueID != null && Request\[uniqueID\] != null) { Theme = Request\[uniqueID\]; Session\["SelectedTheme"\] = Theme; } } }
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterHiddenField(_themeListIDKey, ((DropDownList)(this.Master.FindControl("DropDownList1"))).UniqueID);
}but when i create a skin for gridview onload its not working. when i change another theme and again i come to the current there through dropdown, then only its applying. help me plz.... - Karan
-
const string _themeListIDKey = "_themeListIDKey";
protected void Page_PreInit(object sender, EventArgs e)
{if (IsPostBack) { string uniqueID = Request\[\_themeListIDKey\]; if (uniqueID != null && Request\[uniqueID\] != null) { Theme = Request\[uniqueID\]; Session\["SelectedTheme"\] = Theme; } }else{ Session\["SelectedTheme"\] = This is where you put the desired initial theme; } }