Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Login control FailureTextStyle ForeColor NOT SETTING

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jobs - 24 Oct 2007 12:16 GMT
This is just odd. I've removed all codebehind. The above should work,
but does not. I am using a Login LayoutTemplate. My failure message
come out in blue?? Which is my CSS default color. But I am not
instructing the use of any CSS anywhere here.

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Login.aspx.vb" Inherits="_Login"
   Title="Americatel Retailer Login Page" %>

<!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>Untitled Page</title>
</head>
<body>
   <form id="form1" runat="server">
   <br />
   <br />
           <div style="width: 500px; height: 300px; background:
url(App_Themes/Retailer/images/retaillogin.gif);margin: 0 auto;">
               <asp:Login ID="Login" runat="server"
DestinationPageUrl="~/Main/Default.aspx"
                   Style="margin-left: 30%; margin-top: 35%"
                    >
                    <FailureTextStyle ForeColor="RED"  />
                   <LayoutTemplate>
                   <
                    <div style="position:relative;left:50px;width:
300px" >
                       <asp:Label ID="UserNameLabel"
SkinID="Retailer" runat="server" AssociatedControlID="UserName">User
Name:</asp:Label>
                       <br />
                       <asp:TextBox ID="UserName" width="150px"
SkinID="Retailer" runat="server"></asp:TextBox>
                       <br />
                       <asp:Label ID="PasswordLabel"
skinid="Retailer" runat="server"
AssociatedControlID="Password">Password:</asp:Label>
                       <br />
                       <asp:TextBox ID="Password" width="150px"
skinid="Retailer" runat="server" TextMode="Password"></asp:TextBox>
                       <br />
                       <asp:CheckBox ID="RememberMe"
skinid="Retailer" runat="server" Text="Remember me next time." />
                       <br />
                       <asp:Button ID="LoginButton" skinid="Retailer"
runat="server" CommandName="Login" Text="Log In"
ValidationGroup="Login" />
                       <asp:Button ID="RecoverPassword"
skinid="Retailer" runat="server" Text="Recover Password"
                       PostBackUrl="RecoverPass.aspx"/>
                       <br />
                        <asp:Literal ID="FailureText"
runat="server" EnableViewState="False" ></asp:Literal>
                       </div>
                   </LayoutTemplate>
               </asp:Login>
           </div>
   </form>
</body>
</html>

my css:

body
{
   background-color  :white;
   font-family:ARIAL;
   color: blue;
   Font-Size:10pt;
}
Patrice - 24 Oct 2007 12:32 GMT
For this kind of browser rendering issue your best bet is always to use
"view source" to see the rendered HTML markup rather than to look at the
server side code.

Where is your CSS fragment ? For example if in a theme the CSS file will be
automatically referenced in the rendered page (and using "view source" in
your browser would reveal this).
--
Patrice

> This is just odd. I've removed all codebehind. The above should work,
> but does not. I am using a Login LayoutTemplate. My failure message
[quoted text clipped - 69 lines]
>    Font-Size:10pt;
> }
jobs - 24 Oct 2007 13:00 GMT
Thanks for response. the CSS in a .css file under my app_theme folder.

Here's the view source. No apparently style or color in the literal
error message.

<!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><link href="App_Themes/Retailer/Retailer.css" type="text/css"
rel="stylesheet" /><title>
    Americatel Retailer Login Page
</title></head>
<body>
   <form name="form1" method="post" action="login.aspx?ReturnUrl=
%2fRetailer%2fMain%2fDefault.aspx" id="form1">
<div>
<input type="hidden" name="__LASTFOCUS" id="__LASTFOCUS" value="" />
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /

<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT"
value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/
wEPDwUKLTMwMzI2MjM1OQ9kFgICAw9kFgICAQ88KwAKAQAPFgIeCFVzZXJOYW1lBQVka2RrZGQWAmYPZBYEAgMPDxYCHgRUZXh0BQVka2RrZGRkAgkPEA8WAh4HQ2hlY2tlZGhkZGRkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBRBMb2dpbiRSZW1lbWJlck1ltLvN1+57xetYdDeexvFbQnOZ0AY=" /

</div>

<script type="text/javascript">
<!--
var theForm = document.forms['form1'];
if (!theForm) {
   theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
   if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
       theForm.__EVENTTARGET.value = eventTarget;
       theForm.__EVENTARGUMENT.value = eventArgument;
       theForm.submit();
   }
}
// -->
</script>

<script src="/Retailer/WebResource.axd?d=BiEtBPCj-uSr6pDuF-
rV8w2&amp;t=633198421951393625" type="text/javascript"></script>

<script src="/Retailer/WebResource.axd?
d=1Bb9q1I8mpgggKieouC5Pw2&amp;t=633198421951393625" type="text/
javascript"></script>
   <br />
   <br />
           <div style="width: 500px; height: 300px; background:
url(App_Themes/Retailer/images/retaillogin.gif);margin: 0 auto;">
               <table id="Login" cellspacing="0" cellpadding="0"
border="0" style="border-collapse:collapse;margin-left: 30%; margin-
top: 35%">
    <tr>
        <td>
                   <
                    <div style="position:relative;left:50px;width:
300px" >
                       <label for="Login_UserName"
id="Login_UserNameLabel">User Name:</label>
                       <br />
                       <input name="Login$UserName" type="text"
value="dkdkd" id="Login_UserName" style="background-color:White;border-
width:1px;border-style:Inset;width:150px;" />
                       <br />
                       <label for="Login_Password"
id="Login_PasswordLabel">Password:</label>
                       <br />
                       <input name="Login$Password" type="password"
id="Login_Password" style="background-color:White;border-width:
1px;border-style:Inset;width:150px;" />
                       <br />
                       <span style="background-
color:Transparent;"><input id="Login_RememberMe" type="checkbox"
name="Login$RememberMe" /><label for="Login_RememberMe">Remember me
next time.</label></span>
                       <br />
                       <input type="submit" name="Login$LoginButton"
value="Log In" id="Login_LoginButton" style="color:White;background-
color:#0272A6;border-color:Gray;border-width:1px;border-
style:Inset;font-size:10pt;" />
                       <input type="submit" name="Login
$RecoverPassword" value="Recover Password"
onclick="javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions(&quot;Login$RecoverPassword&quot;,
&quot;&quot;, false, &quot;&quot;, &quot;RecoverPass.aspx&quot;,
false, false))" id="Login_RecoverPassword"
style="color:White;background-color:#0272A6;border-color:Gray;border-
width:1px;border-style:Inset;font-size:10pt;" />
                       <br />
                        Your login attempt was not successful. Please
try again.
                       </div>
                   </td>
    </tr>
</table>
           </div>

<div>

    <input type="hidden" name="__PREVIOUSPAGE" id="__PREVIOUSPAGE"
value="BvuT018k-Zi4UmWhndAO02Nki_AlMByvtTLok0BdMW81" />
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION"
value="/wEWBgKjmMmPBAKl4af/CQL
+pLH2BALY9LKMCwLG8NGxDwL6kouvAvAX9PEhfRht/NdhH/ds3Hk9EPvF" />
</div>

<script type="text/javascript">
<!--
WebForm_AutoFocus('Login');// -->
</script>
</form>
</body>
</html>
Patrice - 24 Oct 2007 13:33 GMT
In  the view source below you can see that you have a link tag in the head
section that references your CSS file. This is automatically done for you
when a css file in your theme folder...

--
Patrice

> Thanks for response. the CSS in a .css file under my app_theme folder.
>
[quoted text clipped - 113 lines]
> </body>
> </html>

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.