using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Diagnostics; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; namespace infoExpediters.Admin { public partial class AdminLogin : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { txtUserName.Focus(); } // checks for user credetials protected void btnLogin_Click(object sender, EventArgs e) { try { if (Page.IsValid) { User objUser = new User(); Hashtable ht = new Hashtable(); ht = objUser.isValidAdminLogin(txtUserName.Text.Trim(), txtPassword.Text.Trim()); if (int.Parse(ht["Status"].ToString()) > 0) { Session["username"] = ht["UserName"].ToString(); Response.Redirect("AdminHome.aspx"); } else { lblMessage.Visible = true; lblMessage.Text = "Invalid password or username"; this.SetFocus(txtUserName); txtUserName.Text = ""; } } } catch (Exception ex) { string s = ex.Message; } } } }