|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using CustomPermission.Model;
namespace CustomPermission
{
public partial class loginForm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void cvLogin_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = (from u in DataContext.Context.Users
where u.Username == txtUsername.Text && u.Password == txtPassword.Text
select u).Count() != 0;
}
protected void btnLogin_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, chkRemember.Checked);
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Taha has started programming at the age of 16 and he has taken an avid interest in Microsoft technologies. He professionally works on ASP.NET and C#. Mainly, He lives for getting the world into codes and follows this aspiration in a third world country with lack of facility and support. He never gives up seeking success and competence.