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.activationquery.ToList().Where(r => r.Activation_Code == activationCode); string activatemyASS = activatem.Select(r => r.Activation_Code).SingleOrDefault(); if (sup.FnActivateAc(activatemyASS) == true) { ActivatedfromDB(activationCode); } else { //ltMessage.Text = ex.Message; ltMessage.Text = "Error in activation, Please try again later!!"; return; } } catch (Exception ex) { //ltMessage.Text = ex.Message; ltMessage.Text = "Error in activation, Please try again later!!"; return; } } }