Como: Criar uma página de login ASP.NET

You can create a login page using the ASP.NET Login control.This control takes a user name and password and uses ASP.NET membership and forms authentication to verify the user's credentials and create an authentication ticket.For information about configuring ASP.NET membership and forms authentication, see Introdução à Associação.

Para criar uma página de logon

  1. Create an ASP.NET Web application that uses ASP.NET membership.For details and examples, see Configurando um aplicativo ASP.NET para usar associação.

  2. Criar um página da Web do ASP.NET no seu aplicativo chamada Login.aspx.

    Observação:

    By default, ASP.NET forms authentication is configured to work with a page named Login.aspx.You can change the default login page name in the Web.config file for your application using the LoginUrl property.

  3. Add a Login control to the page.

  4. Opcionalmente conjunto DestinationPageUrl propriedade com o nome da página que o usuário será redirecionado após fazer o login. Se você não especificar um valor para o DestinationPageUrl propriedade, o usuário será redirecionado para a URL solicitada originalmente depois da autenticação.

    The following example shows the markup for a Login control:

    <asp:Login 
      ID="Login1" 
    
      DestinationPageUrl="~/MembersHome.aspx">
    </asp:Login>
    

Consulte também

Referência

Visão Geral sobre Controles de Login ASP.NET