Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > CSS Formatting not appearing on Login page

Reply
Thread Tools

CSS Formatting not appearing on Login page

 
 
Bazza Formez
Guest
Posts: n/a
 
      03-11-2007
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

 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      03-11-2007
On Mar 11, 8:32 pm, "Bazza Formez" <(E-Mail Removed)> 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">


 
Reply With Quote
 
 
 
 
Bazza Formez
Guest
Posts: n/a
 
      03-11-2007
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



 
Reply With Quote
 
Bazza Formez
Guest
Posts: n/a
 
      03-11-2007
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



 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      03-11-2007
On Mar 11, 9:03 pm, "Bazza Formez" <(E-Mail Removed)> 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.

 
Reply With Quote
 
Bazza Formez
Guest
Posts: n/a
 
      03-11-2007
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

 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      03-11-2007
On Mar 11, 9:34 pm, "Bazza Formez" <(E-Mail Removed)> 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.

 
Reply With Quote
 
Bazza Formez
Guest
Posts: n/a
 
      03-11-2007
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

 
Reply With Quote
 
Bazza Formez
Guest
Posts: n/a
 
      03-11-2007
On Mar 12, 10:42 am, "Bazza Formez" <(E-Mail Removed)> 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.

 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      03-11-2007
On Mar 11, 10:46 pm, "Bazza Formez" <(E-Mail Removed)> wrote:
> On Mar 12, 10:42 am, "Bazza Formez" <(E-Mail Removed)> 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...

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
login page stays on login page Shannon ASP .Net 2 01-09-2008 10:51 PM
Logo.gif file not appearing on web page for client Tony Girgenti ASP .Net Web Services 0 09-13-2006 05:58 PM
Links in Outlook Express not working,page not appearing Thaqalain Computer Support 7 09-30-2005 12:48 PM
Weird formatting problems appearing only in Linux version of FireFox news@celticbear.com Firefox 5 12-30-2004 03:40 PM
Login screen keeps appearing in Windows 2000 Pro. Bun Mui Computer Support 1 08-14-2003 01:42 PM



Advertisments