vu3lmg
asked on
css not applied at runtime
I am attaching a css to and ASPX file.
Design time I see the css style, when I run application I do not see the style.
Following is the line that attaches the css to the page.
__________________________ __________ __________ __________
<head runat="server">
<link rel="stylesheet" type="text/css" href="css/login.css" />
</head>
Design time I see the css style, when I run application I do not see the style.
Following is the line that attaches the css to the page.
__________________________
<head runat="server">
<link rel="stylesheet" type="text/css" href="css/login.css" />
</head>
1. Switch to the Source view (HTML view)
2. Select your css file from the solution explorer
3. Drag & drop your css file (login.css) into the <head> section.
4. Does it look the same as you posted earlier?
2. Select your css file from the solution explorer
3. Drag & drop your css file (login.css) into the <head> section.
4. Does it look the same as you posted earlier?
ASKER
Tried to move in current dir - did not work.
put a "/" in the front - did not work.
More ideas please.
put a "/" in the front - did not work.
More ideas please.
ASKER
prairiedog,
the drag drop of the css looks the same.
Chandresh
the drag drop of the css looks the same.
Chandresh
Are you using any Master page?
ASKER
prairiedog
Yes there is a master file.
I want to load that file after successful login.
Attached is the login.aspx file
Chandresh
Yes there is a master file.
I want to load that file after successful login.
Attached is the login.aspx file
Chandresh
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>PAM Browser</title>
<link href="css/login.css" rel="stylesheet" type="text/css" />
</head>
<body class="loginoverallback">
<form id="form1" runat="server">
<div>
<asp:LoginView ID="LoginView1" runat="server">
<LoggedInTemplate>
You are already logged in
</LoggedInTemplate>
<AnonymousTemplate>
</AnonymousTemplate>
</asp:LoginView>
<asp:Login ID="Login1" runat="server" DisplayRememberMe="False" Font-Bold="True"
Font-Names="Arial" RememberMeText="" Width="361px">
</asp:Login>
<asp:LoginStatus ID="LoginStatus1" runat="server" LoginText="" LogoutText="" />
</div>
</form>
</body>
</html>
Confused. What file do you want to "load"? What do you mean "load"?
ASKER
prairiedog
I want to load Login.aspx file, after a successful login, I want to load the master file.
Chandresh
I want to load Login.aspx file, after a successful login, I want to load the master file.
Chandresh
1. I don't see your Master page.
2. Login.aspx is just a regular web page.
3. Can you post your css file?
2. Login.aspx is just a regular web page.
3. Can you post your css file?
ASKER
prairiedog,
1,2 Sucessful login loads "Default.aspx" which is contained in the master page.
3 Attached is the Login.css.
1,2 Sucessful login loads "Default.aspx" which is contained in the master page.
3 Attached is the Login.css.
.loginoverallback {
background-color: #00476D;
background-image: url(../images/login/login_overallback.jpg);
background-repeat: no-repeat;
}
.loginversiontext {
font-family: Verdana;
font-size: 12px;
font-weight: bold;
color: #FFFFFF;
}
.loginerrortext {
font-family: Verdana;
font-size: 12px;
font-weight: bold;
color: #FDFFB9;
line-height : 20px;
}
.logintext {
font-family: Verdana;
font-size: 12px;
font-weight: bold;
color: #FFFFFF;
}
.logininputtext {
/* font-family: Verdana;
font-size: 12px;
font-weight: bold;
*/ color: #000000;
BORDER-RIGHT: #00476D 1px solid;
BORDER-TOP: #00476D 1px solid;
BORDER-LEFT: #00476D 1px solid;
BORDER-BOTTOM: #00476D 1px solid;
}
.logininputbutton {
font-family: Verdana;
font-size: 11px;
font-weight: bold;
BORDER-RIGHT: #FFFFFF 1px solid;
BORDER-TOP: #FFFFFF 1px solid;
BORDER-LEFT: #FFFFFF 1px solid;
BORDER-BOTTOM: #FFFFFF 1px solid;
CURSOR: hand;
background-color: #00476D;
color: #FFFFFF;
width: 50px;
}
Try assigning class="loginoverallback" to the <div> tag, instead of the <body> tag.
ASKER
prairiedog
Did not work (assigning the class to <div> tag). Same results.
Did not work (assigning the class to <div> tag). Same results.
I am still confused, sorry. Let me confirm this: it is login.aspx that does not show the style, right? After user logs in, they will be redirected to default.aspx?
ASKER
Yes, you are right
Login.aspx does not show the style at runtime.
At design time it does show the style.
Login.aspx does not show the style at runtime.
At design time it does show the style.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Attached is the zipped folder of part of my project.
I am having problems with this as well
Please have a look at it.
I am having problems with this as well
Please have a look at it.
ASKER
I am not able to attach the zipped folder. Is there a way to send you the code.
All files uploaded here have to be in plain text format.
Have you tried changing background-image: url(images/login/login_ove rallback.j pg);
Have you tried changing background-image: url(images/login/login_ove
ASKER
Yes I tried changing background-image: url(images/login/login_ove rallback.j pg);
Strangly, I copied the project to another PC and it works there !!
Strangly, I copied the project to another PC and it works there !!
With the same folder structure and hierarchy?
ASKER
Strange
Now it works on my PC as well. Even with ../ or without !!
Let me know if you have any more ideas or I will close this by accepting one of your suggestions.
Now it works on my PC as well. Even with ../ or without !!
Let me know if you have any more ideas or I will close this by accepting one of your suggestions.
<head runat="server">
<link rel="stylesheet" type="text/css" href="/css/login.css" />
</head>
the slash in front of the directory is necessary sometimes.