 |
|
 |
Hi,
Your edream site is currently down(30NOV2011). Please make it live.
|
|
|
|
 |
|
 |
For showing how to deal with themes when using Master Page.
|
|
|
|
 |
|
|
 |
|
 |
This is the best solution for dynamic theme..
|
|
|
|
 |
|
|
 |
|
 |
u don't able to express properly
|
|
|
|
 |
|
 |
Hi Sue,
Thanks for such nice article. Its helped me lot.
Regards,
Prathamesh.
|
|
|
|
 |
|
 |
Worked in minutes, elegant solution... thanks for sharing.
|
|
|
|
 |
|
 |
help me to start with dynamic web asp.net c#
|
|
|
|
 |
|
 |
Hi all/Sue,
I would like to change look and feel of portions of the sites pages (like the borders and back color of certain div's, back color of homepage banner etc.) based on selected theme. In my case, I have primary and secondary colors which are the 7 rainbow colors. The user would be provided with a screen in which the all primary colors are displayed and the user can select any secondary color from the drop down list in front of every primary color and a checkbox which would make that theme active.
Can anybody please advise how to proceed on this.
|
|
|
|
 |
|
 |
Your article on themes is awesome. It really helped me a lot. Thanks for your post.
My problem is, I need my website to allow themes as well as use ajax, so my asp.net imagebutton will not be the server control, it will be an img and onclick of the button i want to call a javascript function. Do you know, how to load the images accordingly to html img controls based on the theme.
Thanks in advance... Please help me out. The css property background-image is not working, it shows a red cross just front of the image....
Abhishek Sur
Web Developer
|
|
|
|
 |
|
 |
Is there a flow chart posted any place that shows dynamic themes work?
|
|
|
|
 |
|
 |
Can someone somehow make it work without the server.tranfer?
I have used profiles in place of sessions. I would like my site to remember the theme selected by the user last time.
Web.config:
===========
anonymousIdentification enabled="true"/
profile
properties
add name="Theme" defaultValue ="Green" allowAnonymous ="true"/
/properties
/profile
SelectedIndexChanged event on Master file:
==========================================
Profile.Theme = ddlTheme.SelectedValue;
Server.Transfer(Request.FilePath);
On PreInit event on Base Page:
==============================
base.OnPreInit(e);
if (!String.IsNullOrEmpty(HttpContext.Current.Profile.GetPropertyValue("Theme").ToString()))
{
Page.Theme = HttpContext.Current.Profile.GetPropertyValue("Theme").ToString();
}
|
|
|
|
 |
|
 |
The problem is, when you select an item in the radiobuttonlist. A postback event is fired.
so the page is refreshed and in the selectedindexchanged there's a server.transfer.
So the page is loaded twice in order to change the theme.
I'm sure there's a better to handle this.
|
|
|
|
 |
|
 |
My web is like this:
MyWeb
---App_Code
------Theme.cs
------ThemeManager.cs
---App_Themes
------Blue
------Red
---Child
------childpage.aspx
---default.aspx
---masterpage.master
I have problem when i use HttpContext.Current.Server.MapPath("App_Themes") function in GetThemes method in ThemeManager.cs.
It's work good when i access default.aspx page. But error when i access childpage.aspx page. At that time, HttpContext.Current.Server.MapPath("App_Themes") will refer to MyWeb/Child/App_Themes. So i can't get Theme list.
How can i fix this problem. Thank you very much!
|
|
|
|
 |
|
 |
I fixed it.
Thank you very much.
|
|
|
|
 |
|
 |
Thanks for your help, I've been trying to accomplish this for a while. Odd that such a key functionality was not implemented by MS.
Is there any easy way to persist the chosen theme across multiple sessions? Without storing your choice in a database?
|
|
|
|
 |
|
 |
Modify your BasaPage::OnPreInit:
protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
if (!IsPostBack)
{
if (Session["MyTheme"] == null)
{
if ((Request.Cookies["MyTheme"] != null) &&
(Request.Cookies["MyTheme"].Value.Length != 0))
Page.Theme = Request.Cookies["MyTheme"].Value;
else
Page.Theme = "White";
Session.Add("MyTheme", Page.Theme);
}
else
{
Page.Theme = ((string)Session["MyTheme"]);
}
}
}
Modify your Default_aspx::strTheme_DataBound:
protected void strTheme_DataBound(object sender, EventArgs e)
{
if(!IsPostBack)
strTheme.SelectedValue = Page.Theme;
}
Modify your Default_aspx::strTheme_SelectedIndexChanged:
protected void strTheme_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Cookies["MyTheme"].Value = strTheme.SelectedValue;
Response.Cookies["MyTheme"].Expires = DateTime.Now.AddYears(30);
Session.Add("MyTheme", strTheme.SelectedValue);
Server.Transfer(Request.FilePath);
}
and you will persist the state using cookies.
Hope this helps.
modified on Friday, December 5, 2008 1:53 PM
|
|
|
|
 |
|
 |
dear ,
do u have spacific example about this .
rgards
MDaraghmeh
.Net Developer
Jordan- Amman
00962-78-452450
m-daraghmeh@hotmail.com
|
|
|
|
 |
|
 |
it,s cool
good luke
|
|
|
|
 |
|
 |
Anyone that know how or if it's possible to upload a new theme folder (w/skin file etc) without having to recompile the site and uploading /bin ?
Chao ab ordo
|
|
|
|
 |
|
 |
Just add a new theme to the Theme folder in the web server and you're done (since the theme radiobutton is populated based on this folder).
"Blessed is the man who finds wisdom, the man who gains understanding."
Proverbs 3:13
|
|
|
|
 |
|
 |
Thanks Sue,
This is wat i wanted in my new project. But basically main issue is image. Is it must that we should access image by making them as image control in the skin file. Don't we put the path directly in the images or where needed.
Thank you,
Manish Pansiniya
maniish.wordpress.com[^]
|
|
|
|
 |
|
 |
Thanks sue! Your sample is really great, it's just what I need.
|
|
|
|
 |
|
 |
Hi,
Is it not possible to use PreInit of mater page instead of the Base page that is inherited by all pages.
Thanks for the short tips anyway!!
Addisu H. Desta
.NET Developer
MCP, MCAD in .NET
|
|
|
|
 |