change web.config programmatically

Discussion in 'ASP .Net Web Controls' started by arlene, Jun 2, 2006.

  1. arlene

    arlene Guest

    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!
     
    arlene, Jun 2, 2006
    #1
    1. Advertising

  2. arlene

    Brock Allen Guest

    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.

    -Brock
    http://staff.develop.com/ballen


    > 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!
    >
     
    Brock Allen, Jun 2, 2006
    #2
    1. Advertising

  3. arlene

    arlene Guest

    thank you so much for the immediate reply.

    "Brock Allen" wrote:

    > 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.
    >
    > -Brock
    > http://staff.develop.com/ballen
    >
    >
    > > 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!
    > >

    >
    >
    >
     
    arlene, Jun 8, 2006
    #3
  4. arlene

    arlene Guest

    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

    "Brock Allen" wrote:

    > 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.
    >
    > -Brock
    > http://staff.develop.com/ballen
    >
    >
    > > 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!
    > >

    >
    >
    >
     
    arlene, Jun 8, 2006
    #4
  5. arlene

    arlene Guest

    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.

    "arlene" wrote:

    > 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
    >
    > "Brock Allen" wrote:
    >
    > > 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.
    > >
    > > -Brock
    > > http://staff.develop.com/ballen
    > >
    > >
    > > > 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!
    > > >

    > >
    > >
    > >
     
    arlene, Jun 8, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stewart Armbrecht

    Modify Web.Config Programmatically?

    Stewart Armbrecht, Mar 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    6,126
    shailpatel83
    Feb 17, 2010
  2. TK
    Replies:
    2
    Views:
    2,540
  3. Benny Ng
    Replies:
    9
    Views:
    10,233
    Benny Ng
    Oct 13, 2005
  4. CSharpner
    Replies:
    0
    Views:
    1,132
    CSharpner
    Apr 9, 2007
  5. Dan
    Replies:
    4
    Views:
    590
Loading...

Share This Page