Enhanced Login control designed for mobile web browsers.

Namespace: FiftyOne.Framework.Mobile.Controls
Assembly: FiftyOne.Framework (in FiftyOne.Framework.dll) Version: 2.0.2.1 (2.0.2.1)

Syntax

C#
[BindableAttribute(false)]
[DefaultEventAttribute("Authenticate")]
[ToolboxBitmapAttribute("FiftyOne.Framework.Mobile.Controls.Login")]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class Login : CompositeControl, IStyle, 
	IUrlResolutionService, ICssIncludeGroup
Visual Basic
<BindableAttribute(False)> _
<DefaultEventAttribute("Authenticate")> _
<ToolboxBitmapAttribute("FiftyOne.Framework.Mobile.Controls.Login")> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class Login _
	Inherits CompositeControl _
	Implements IStyle, IUrlResolutionService, ICssIncludeGroup
Visual C++
[BindableAttribute(false)]
[DefaultEventAttribute(L"Authenticate")]
[ToolboxBitmapAttribute(L"FiftyOne.Framework.Mobile.Controls.Login")]
[AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)]
public ref class Login : public CompositeControl, 
	IStyle, IUrlResolutionService, ICssIncludeGroup

Examples

The following code example uses a Login control to provide a UI for logging in to a Web site.

CopyXML
<mob:Login id="Login1" runat="server" BorderStyle="Solid" BackColor="#F7F7DE" 
    BorderWidth="1px" BorderColor="#CCCC99" Font-Size="10pt" Font-Names="Verdana" 
    CreateUserText="Create a new user..." CreateUserUrl="newUser.aspx" HelpPageUrl="help.aspx"
    PasswordRecoveryUrl="getPass.aspx" UserNameLabelText="E-mail address:" 
    OnLoggingIn="OnLoggingIn" OnLoginError="OnLoginError" >
    <TitleTextStyle Font-Bold="True" ForeColor="#FFFFFF" BackColor="#6B696B">
    </TitleTextStyle >
</mob:Login>
CopyC#
private bool IsValidEmail(string strIn)
{
   // Return true if strIn is in valid e-mail format.
    return Regex.IsMatch(strIn, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"); 
}
protected void Login1_LoggingIn(object sender, LoginCancelEventArgs e)
{
   if (!IsValidEmail(Login1.UserName))
   {
       Login1.InstructionText = "Enter a valid e-mail address.";
       Login1.InstructionTextStyle.ForeColor = System.Drawing.Color.RosyBrown;
       e.Cancel = true;
   }
   else
   {
       Login1.InstructionText = String.Empty;
   }
}
protected void Login1_LoginError(object sender, EventArgs e)
{
    Login1.HelpPageText = "Help with logging in...";
    Login1.PasswordRecoveryText = "Forgot your password?";
}

Inheritance Hierarchy

See Also