0

Visual studio 2012 is warning that the first line of this class is obsolete:

if (FormsAuthentication.Authenticate(UserName.Text, Password.Text) == true)

 public void LoginClass(object s, EventArgs e)
{
    if (FormsAuthentication.Authenticate(UserName.Text, Password.Text) == true)
    {
        FormsAuthentication.SetAuthCookie(UserName.Text, true);
        Response.Redirect("admin/default.aspx");
    }
    else
    {
        if (DBAuthenticate(UserName.Text, Password.Text))
        {
            FormsAuthentication.SetAuthCookie(UserName.Text, true);
            Response.Redirect("members/default.aspx");
        }
        else
        {
            LtlLogin.Text = "<p>Sorry wrong login details</p>";
        }
    }

}

I would appreciate some help. With what should I replace such line of code in framework 4.5 ?

Nullbyte
  • 231
  • 1
  • 6
  • 16

1 Answers1

0

The error message itself, or the MSDN reference page, does show you what new APIs to use, so I don't think you need some help but help yourself,

http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.authenticate(v=vs.110).aspx

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • Thanks! I will study it. However I was looking for an hint because I just started coding on my own. – Nullbyte Apr 01 '14 at 09:49