CSS Formatting not appearing on Login page

Discussion in 'ASP .Net' started by Bazza Formez, Mar 11, 2007.

  1. Bazza Formez

    Bazza Formez Guest

    Hi,

    I have an app which utilizes forms security. I have a Login.aspx page
    which references my MasterPage.master. The master page in turn
    references a css.

    In the designer of VS 2005, the Login page renders correctly.... with
    correct formatting as provided by my css.

    At application runtime however, all formatting disappears on the login
    page... no css formatting occurs at all.

    Note that other pages in the app (ie. subsequent to login) appear
    correctly formatted. This is puzzling!

    Another hint : this was all working until I created a sub-directory
    under the root of the app & moved web pages to there.

    My ide is VS 2005 (completely up to date version).

    Any ideas ?

    Thanks,
    Bazza
     
    Bazza Formez, Mar 11, 2007
    #1
    1. Advertising

  2. On Mar 11, 8:32 pm, "Bazza Formez" <> wrote:
    > Hi,
    >
    > I have an app which utilizes forms security. I have a Login.aspx page
    > which references my MasterPage.master. The master page in turn
    > references a css.
    >
    > In the designer of VS 2005, the Login page renders correctly.... with
    > correct formatting as provided by my css.
    >
    > At application runtime however, all formatting disappears on the login
    > page... no css formatting occurs at all.
    >
    > Note that other pages in the app (ie. subsequent to login) appear
    > correctly formatted. This is puzzling!
    >
    > Another hint : this was all working until I created a sub-directory
    > under the root of the app & moved web pages to there.
    >
    > My ide is VS 2005 (completely up to date version).
    >
    > Any ideas ?
    >
    > Thanks,
    > Bazza


    Do you use an absolute path with slash at beginning to CSS?

    e.g.

    <link type="text/css" href="/style.css" rel="stylesheet">
     
    Alexey Smirnov, Mar 11, 2007
    #2
    1. Advertising

  3. Bazza Formez

    Bazza Formez Guest

    Hi Alexey,

    Thanks for your reply.

    The code I had was :
    <link href="styles.css" rel="stylesheet" type="text/css" />

    (By the way ... The css is in the same directory as the masterpage.)

    I have tried the following using an absolute path ....
    <link href="~/mydirectory/styles.css" rel="stylesheet" type="text/
    css" />

    But this also gave same problem..

    Any other ideas Alexey ?

    Many thanks,
    Bazza
     
    Bazza Formez, Mar 11, 2007
    #3
  4. Bazza Formez

    Bazza Formez Guest

    Hi Alexey,

    Thanks for your reply.

    The code I had was :
    <link href="styles.css" rel="stylesheet" type="text/css" />

    (By the way ... The css is in the same directory as the masterpage.)

    I have tried the following using an absolute path ....
    <link href="~/mydirectory/styles.css" rel="stylesheet" type="text/
    css" />

    But this also gave same problem..

    Any other ideas Alexey ?

    Many thanks,
    Bazza
     
    Bazza Formez, Mar 11, 2007
    #4
  5. On Mar 11, 9:03 pm, "Bazza Formez" <> wrote:
    > I have tried the following using an absolute path ....
    > <link href="~/mydirectory/styles.css" rel="stylesheet" type="text/
    > css" />


    This is wrong. The tilda-prefix "~" can be used for server-side
    controls only.

    So, please try

    <link href="/mydirectory/styles.css" ....

    If this still doesn't work, check if it's not the cache problem.
    Refresh the login page with Ctrl+F5, or delete all cached files.
     
    Alexey Smirnov, Mar 11, 2007
    #5
  6. Bazza Formez

    Bazza Formez Guest

    Thanks.

    (In masterpage) I changed it to :

    <link href="/mydirectory/styles.css" rel="stylesheet" type="text/css" /
    > ...


    still same prob.

    Note that all other pages in site using same masterpage work fine....


    Can you tell me where cached files live please ?

    thanks,
    Bazza
     
    Bazza Formez, Mar 11, 2007
    #6
  7. On Mar 11, 9:34 pm, "Bazza Formez" <> wrote:
    > Thanks.
    >
    > (In masterpage) I changed it to :
    >
    > <link href="/mydirectory/styles.css" rel="stylesheet" type="text/css" /
    >
    > > ...

    >
    > still same prob.


    So, let's check:

    1. login.aspx used a master
    2. login.aspx, masterpage, styles.css are in the same directory
    (mydirectory)
    3. site has the following structure:

    root
    ------mydirectory
    ---------------login.aspx
    ---------------masterpage
    ---------------styles.css
    ---------------others


    >
    > Note that all other pages in site using same masterpage work fine....
    >
    > Can you tell me where cached files live please ?


    You can remove the IE cache from menu (Tools - Internet Options,
    Browsing History...). IE has a problem with caching the CSS and maybe
    you cannot see the style because of this problem. Maybe you can try to
    restart the web server.
     
    Alexey Smirnov, Mar 11, 2007
    #7
  8. Bazza Formez

    Bazza Formez Guest

    I deleted cache.. no luck there.

    1. yes, login.aspx uses the master page
    2. login.aspx, master page * styles.css all in same directory
    3. My directory structure is just as you have described....

    Full structure (in case it helps) is :

    root
    -----web.config
    -----web.sitemap
    -----App_Code (asp.net folder)
    ---------------BLL directory
    ---------------DAL directory
    -----App_Data (asp.net folder)
    ---------------mydb.mdb
    -----MyDirectory directory
    ---------------styles.css
    ---------------masterpage.master
    ---------------login.aspx
    ---------------other aspx pages
     
    Bazza Formez, Mar 11, 2007
    #8
  9. Bazza Formez

    Bazza Formez Guest

    On Mar 12, 10:42 am, "Bazza Formez" <> wrote:
    > I deleted cache.. no luck there.
    >
    > 1. yes, login.aspx uses the master page
    > 2. login.aspx, master page * styles.css all in same directory
    > 3. My directory structure is just as you have described....
    >
    > Full structure (in case it helps) is :
    >
    > root
    > -----web.config
    > -----web.sitemap
    > -----App_Code (asp.net folder)
    > ---------------BLL directory
    > ---------------DAL directory
    > -----App_Data (asp.net folder)
    > ---------------mydb.mdb
    > -----MyDirectory directory
    > ---------------styles.css
    > ---------------masterpage.master
    > ---------------login.aspx
    > ---------------other aspx pages


    By the way, all was working ok until I added the My directory level
    into the mix and & moved web pages, master & styles.css into that.
     
    Bazza Formez, Mar 11, 2007
    #9
  10. On Mar 11, 10:46 pm, "Bazza Formez" <> wrote:
    > On Mar 12, 10:42 am, "Bazza Formez" <> wrote:
    >
    >
    >
    >
    >
    > > I deleted cache.. no luck there.

    >
    > > 1. yes, login.aspx uses the master page
    > > 2. login.aspx, master page * styles.css all in same directory
    > > 3. My directory structure is just as you have described....

    >
    > > Full structure (in case it helps) is :

    >
    > > root
    > > -----web.config
    > > -----web.sitemap
    > > -----App_Code (asp.net folder)
    > > ---------------BLL directory
    > > ---------------DAL directory
    > > -----App_Data (asp.net folder)
    > > ---------------mydb.mdb
    > > -----MyDirectory directory
    > > ---------------styles.css
    > > ---------------masterpage.master
    > > ---------------login.aspx
    > > ---------------other aspx pages

    >
    > By the way, all was working ok until I added the My directory level
    > into the mix and & moved web pages, master & styles.css into that.- Hide quoted text -
    >
    > - Show quoted text -


    I have really no idea what's wrong here.

    Open your http://localhost/MyDirectory/login.aspx with no style, right
    click - View Source. Check what was generated by ASP.NET. Make sure
    that it is

    <link href="/MyDirectory/styles.css" ...

    Make sure that there no other CSS styles in use and HTML layout is
    correct.

    Try to save the source as a separated HTML file, e.g.
    http://localhost/MyDirectory/login.htm to see if this work properly
    with CSS in IE and in VS.NET.

    Hope, it helps...
     
    Alexey Smirnov, Mar 11, 2007
    #10
  11. Bazza Formez

    Bazza Formez Guest

    On Mar 12, 11:01 am, "Alexey Smirnov" <>
    wrote:
    > On Mar 11, 10:46 pm, "Bazza Formez" <> wrote:
    >
    >
    >
    >
    >
    > > On Mar 12, 10:42 am, "Bazza Formez" <> wrote:

    >
    > > > I deleted cache.. no luck there.

    >
    > > > 1. yes, login.aspx uses the master page
    > > > 2. login.aspx, master page * styles.css all in same directory
    > > > 3. My directory structure is just as you have described....

    >
    > > > Full structure (in case it helps) is :

    >
    > > > root
    > > > -----web.config
    > > > -----web.sitemap
    > > > -----App_Code (asp.net folder)
    > > > ---------------BLL directory
    > > > ---------------DAL directory
    > > > -----App_Data (asp.net folder)
    > > > ---------------mydb.mdb
    > > > -----MyDirectory directory
    > > > ---------------styles.css
    > > > ---------------masterpage.master
    > > > ---------------login.aspx
    > > > ---------------other aspx pages

    >
    > > By the way, all was working ok until I added the My directory level
    > > into the mix and & moved web pages, master & styles.css into that.- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > I have really no idea what's wrong here.
    >
    > Open yourhttp://localhost/MyDirectory/login.aspxwith no style, right
    > click - View Source. Check what was generated by ASP.NET. Make sure
    > that it is
    >
    > <link href="/MyDirectory/styles.css" ...
    >
    > Make sure that there no other CSS styles in use and HTML layout is
    > correct.
    >
    > Try to save the source as a separated HTML file, e.g.http://localhost/MyDirectory/login.htmto see if this work properly
    > with CSS in IE and in VS.NET.
    >
    > Hope, it helps...- Hide quoted text -
    >
    > - Show quoted text -


    Thanks so much for your help Alexey. I very much appreciate it.
     
    Bazza Formez, Mar 11, 2007
    #11
  12. Bazza Formez

    Bazza Formez Guest

    OK.. problem now solved.

    It turns out that the permissions were all wrong. Using the security
    settings of the website administration tool I was able to correct
    access permissions to directories such that CSS file was no longer
    protected to a user that had not yet logged on.
     
    Bazza Formez, Mar 12, 2007
    #12
    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. Hermit Dave

    Forms Login Page Not Login Out

    Hermit Dave, Jan 12, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    520
    Hermit Dave
    Jan 13, 2004
  2. Shannon

    login page stays on login page

    Shannon, Jan 9, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    574
    Shannon
    Jan 9, 2008
  3. jmhmaine
    Replies:
    0
    Views:
    310
    jmhmaine
    Jan 20, 2005
  4. jmhmaine
    Replies:
    2
    Views:
    336
    Steven Cheng[MSFT]
    Jan 21, 2005
  5. Tony Girgenti

    Logo.gif file not appearing on web page for client

    Tony Girgenti, Sep 13, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    124
    Tony Girgenti
    Sep 13, 2006
Loading...

Share This Page