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.consActivationQuery.ToList().Where(r => r.Activation_Code == activationCode); string activatemyASS = activatem.Select(r => r.Activation_Code).SingleOrDefault(); if (sup.FnActivateConsultant(activatemyASS) == true) { //ltMessage.Text = "Your Acount has been activated successfully!"; ActivatedfromDB(activationCode); } else { ltMessage.Text = "Your Acount Could not be activated!"; } } catch (Exception ex) { //ltMessage.Text = ex.Message; ltMessage.Text = "Error in activation, Please try again later!!"; return; } } }