protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { var credentials = new NetworkCredential(ConfigurationManager.AppSettings["W_USER"], ConfigurationManager.AppSettings["W_PWD"], ConfigurationManager.AppSettings["DOMAIN"]); Portals sup = new Portals(); sup.Credentials = credentials; sup.PreAuthenticate = true; string activationCode = Request.QueryString["ActivationCode"]; Guid.Empty.ToString(); string myusername = Request.QueryString["username"]; var activatem = nav.grantees_Register.ToList().Where(r => r.Activation_Code == activationCode); string activatemyASS = activatem.Select(r => r.Activation_Code).SingleOrDefault(); if (sup.FnActivateGrantee(activatemyASS) == true) { // ltMessage.Text = "Your Acount has been activated successfully."; ActivatedfromDB(activationCode); } } catch (Exception ex) { ltMessage.Text = ex.Message; //ltMessage.Text = "Error in activation, Please try again later!!"; return; } } }