Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //load textfields to local variables
- string User = UserName.Text.ToLower().Trim();
- string Pass = UserPass.Text.ToLower().Trim();
- //Check Credentials
- var xrm = new XrmServiceContext("Xrm");
- var Inspectors = from i in xrm.SystemUserSet
- where i.new_MobileAppUser.Equals(User.ToString())
- select new { InspectorPass = i.new_MobileAppPassword
- };
- if (User == null || Pass == null)
- {
- lblMsg.Text = "You must enter a valid username and password";
- }
- if (Inspectors == Pass)
- {
- // do something (correct password)
- FormsAuthentication.RedirectFromLoginPage(UserName.Text, chkPersistCookie.Checked);
- Response.Redirect("/default.aspx");
- }
- else
- {
- // something else (incorrect password)
- lblMsg.Text = "Sorry, Invalid credentials. Please try again.";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement