question about theme

B

Ben

Hi,

I'm testing theme and dtylesheettheme properties of 'Page' like this:
('test' is a directory of App_Themes).

Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.PreInit
'Page.Theme = "test"
Page.StyleSheetTheme = "test"
End Sub

With Page.Theme, no problem, but with Page.StylesheetTheme, i get the error:
"The StyleSheetTheme property cannot be set, please override the property
instead"


When putting it into the aspx file, it works:
<%@ Page Language="VB" StylesheetTheme="test" CodeFile="theme.aspx.vb"
Inherits="theme" %>

How to correct that?
Thanks
Ben
 
B

Ben

Hi Alexey, thaks for replying.

I found this in your link:
public override string StyleSheetTheme
{
get{ retrun "MyStyleSheetTheme"; }
}

It's C# and I translated it into:
public override StyleSheetTheme() as string
get
return "test"
end get
end property

but i can't put it into event PreInit nor in Page OnLoad, so where do i have
to put it and how to link it to the code-behind file?

Thanks
 
G

Guest

Hi Alexey, thaks for replying.

I found this in your link:
public override string StyleSheetTheme
{
get{ retrun "MyStyleSheetTheme"; }

}

It's C# and I translated it into:
public override StyleSheetTheme() as string
get
return "test"
end get
end property

but i can't put it into event PreInit nor in Page OnLoad, so where do i have
to put it and how to link it to the code-behind file?

As I understood this post
http://www.vikramlakhotia.com/Dynamically_changing_themes_and_applying_styles_in_aspnet_20.aspx

your page has to be inherited from, say, "basewebpage" which inherits
from System.Web.UI.Page and then StyleSheetTheme has to be placed in
basewebPage

I found also another interesting post, take a look at
http://weblogs.asp.net/scottgu/arch...and-Style-Personalization-with-ASP.NET--.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top