www.webdeveloper.com
Results 1 to 3 of 3

Thread: master page question

  1. #1
    Join Date
    Oct 2005
    Posts
    80

    master page question

    Well, I don't seem to be getting any help over at the .net forum so maybe you can help.

    I have a master page and master style page. How can I have a style sheet linked to a "child" page? When I try to insert one it doesn't seem to like living within the tags given for a child page. Does the master style sheet have access to the child's components? They don't seem to change when I set up properties in the master style sheet.

    Thanks
    Rut

  2. #2
    Join Date
    Jun 2004
    Location
    Kansas City, MO
    Posts
    1,607
    rutledj,
    I think that you dont have the pathing set up correctly. I had some issues w/ the whole style sheet thing. Instead i found out about themes and they are worth looking into.

    Here is how i have mine set up.
    The mast page is at the root of the web. You could really have this anywhere you want it. Then i created the folder
    App_Themes (This is a special .net folder such as App_Code, App_Data)

    In the App_Themes Folder you add a new .net folder ( a theme folder is the only folder you can add at this level). I have two themes (Black, White).

    In each Folder i have my .css file for the whole site plus an Images folder ( in this level you can actually add a folder).

    Now in my web.config page i have this code
    <pages styleSheetTheme="Black"/>

    This tells the site to use the .css sheet associated with the Black theme.

    So in the end i have to themes set up which means i have 2 different css files for the site. Depending on which 1 i choose it will completly change the way the site looks and feels. THis is the great thing about Themes.

    You can also change themes in code. So you can have like a user settings and allow the user to select which look they want.

    You have to set this in the Page_PreInt sub. ..

    Code:
      Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
            Page.Theme = "White"
        End Sub
    Hope that helps

  3. #3
    Join Date
    Oct 2005
    Posts
    80
    My problem is that I want to handle the positioning of a gridview component using a style sheet. The gridview is in the contentcontainer of the child sheet. Using it's id, I can't seem to do anything that has any effect on it regardless if I put the style properties the master.css sheet.

    I tried creating a stylesheet just for that particular child sheet but couldn't figure out how to link it to the child. The code complains when I stick the reference in the child <asp tags.

    Rut

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles