Can't set Login.FailureTextStyle.ForeColor ?

J

jobs

This code works at setting my login failure message, but does not set
the color for some reason.

Protected Overrides Sub OnLoad(ByVal e As EventArgs)
If IsPostBack Then
If Login.FailureText <> "" Then
Login.FailureTextStyle.ForeColor = Drawing.Color.Red
Login.FailureText = "Unsuccessful Login. Try Again"
End If

End If
End Sub


I've tried setting the color and the text in the control's
properties , and there neither work.


<asp:Login ID="Login" runat="server"
DestinationPageUrl="~/Main/Default.aspx"
Style="margin-left: 30%; margin-top: 35%"
InstructionText="Login Unsuccessful. Try Again"
<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>


Thanks for any help or information.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top