Hi Adam:
Thank you for your help!
This is my signin.ascx.cs file:
using System;
using System.Collections;
using System.Configuration;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Security;
using ASPNetPortal;
using System.Web.Mail;
namespace Syntegra.Manufacturing.WMCCM.Web.UI.DesktopModules {
public abstract class Signin : ASPNetPortal.PortalModuleControl {
protected System.Web.UI.WebControls.TextBox email;
protected System.Web.UI.WebControls.TextBox password;
protected System.Web.UI.WebControls.ImageButton SigninBtn;
protected System.Web.UI.WebControls.ImageButton RegisterBtn;
protected System.Web.UI.WebControls.Literal responseLiteral;
protected System.Web.UI.WebControls.LinkButton EmailPassword;
protected System.Web.UI.WebControls.CheckBox RememberCheckbox;
protected Syntegra.Manufacturing.Wmccm.Web.UI.CustomControls.Label EmailLabel;
protected Syntegra.Manufacturing.Wmccm.Web.UI.CustomControls.Label PasswordLabel;
protected System.Web.UI.WebControls.Label Message;
private void LoginBtn_Click(Object sender, ImageClickEventArgs e)
{
// extract the details
string strEmail = email.Text.Trim().ToLower();
string strPassword = password.Text.Trim();
// Attempt to Validate User Credentials using UsersDB
UsersDB accountSystem = new UsersDB();
String userId = accountSystem.Login(strEmail, strPassword);
if ((userId != null) && (userId != ""))
{
// initialize the authentication
FormsAuthentication.Initialize();
// Log User Off from Cookie Authentication System
FormsAuthentication.SignOut();
// Invalidate roles token
Response.Cookies["portalroles"].Value = null;
Response.Cookies["portalroles"].Expires = new System.DateTime(1999, 10, 12);
Response.Cookies["portalroles"].Path = "/";
// destroy the session thing!!
Session["UserAccessControl"] = null;
// Use security system to set the UserID within a client-side Cookie
FormsAuthentication.SetAuthCookie(strEmail, false);
// Redirect browser back to originating page
string url = Request.ApplicationPath;
if (Session["LogonReturnToPage"] != null)
{
url = (string) Session["LogonReturnToPage"];
Session["LogonReturnToPage"] = null;
}
Response.Redirect(url);
}
else
{
Message.Text = "<" + "br" + ">Login Failed!" + "<" + "br" + ">";
responseLiteral.Text = "<script language=javascript>alert('Login Failed!');</script>";
}
}
So to process two lines highlighted in yellow, I have to use the three lines highlighted by blue, and how should I do with these?
I have uploaded the signin.ascx.cs file
here, could you give me some ideas? cheers!