Advertisement
LYSoft

Untitled

May 9th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.77 KB | None | 0 0
  1. Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnLogin.Click
  2.     processLogin()
  3. End Sub
  4.  
  5. Private Sub processLogin()
  6.     Dim us As New User(txtEmail.Text, txtPassword.Text)
  7.  
  8.     Try
  9.         us.Login()
  10.  
  11.         FormsAuthentication.RedirectFromLoginPage(txtEmail.Text, true)
  12.  
  13.         If String.IsNullOrEmpty(Request.Params("returnUrl"))
  14.             Response.Redirect("~/User/Default.aspx")
  15.         Else
  16.             Response.Redirect(Request.Params("returnUrl")
  17.         End If
  18.     Catch ex As Exception
  19.         lblErrorAction.Text = "Login"
  20.         lblErrorMessage.Text = String.Format("Error actioning request: [ {0} ]", ex.Message)
  21.         pnlErrorBackground.Visible = True
  22.         pnlErrorModal.Visible = True
  23.     End Try
  24. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement