change web.config programmatically

A

arlene

hi,
i already created an app_theme folder in the project and configured the
pagesection of we.config to assign my desired theme. but my problem is how
can i change the value of styleSheetTheme in the pagesection of web.config
everytime the user select a theme from the dropdown control in a page so that
it applies to the whole project not just in a one page. hope you can help me.
thank you!
 
B

Brock Allen

It sounds like to me that you want to dynamically change the Theme for the
user? If this is what you want to do, check out the Page_PreInit event --
this event is for dynamically assigning the Theme for the Page being requested.
So you can allow the user to choose their Theme preference and store that
in a database or in the Profile, and the load it in Page_PreInit.
 
A

arlene

thank you so much for the immediate reply.

Brock Allen said:
It sounds like to me that you want to dynamically change the Theme for the
user? If this is what you want to do, check out the Page_PreInit event --
this event is for dynamically assigning the Theme for the Page being requested.
So you can allow the user to choose their Theme preference and store that
in a database or in the Profile, and the load it in Page_PreInit.
 
A

arlene

i test the project using your suggestion but it doen't work. i first add the
script in the global.asax and add the pageevent.cs and the ddl and then run.
but i encountered an error that says, " the type or namespace name
'PageEventArgs' could not be foune". hope we can fix it. thank you
 
A

arlene

i fixed the error. but i have a configuration errr in the httmodules section
in the web.config. in addition, do you s sample code where can i change the
value of the theme that i assign in the global asax? thank you.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top