using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MembershipLogin : System.Web.UI.Page
{
   protected void btnLogin_Click(object sender, EventArgs e)
   {
      string user = txtUser.Text;
      string password = txtPassword.Text;

      if ( Membership.ValidateUser(txtUser.Text,txtPassword.Text) )
         FormsAuthentication.RedirectFromLoginPage(user, true);
      else
         labError.Text = "Użytkownika nie odnaleziono. Proszę spróbować ponownie";
   }
}
