private void BtnLogon_Click(object sender, System.EventArgs e)
        {
            bool passwordVerified = false;

            try
            {
                ReportServerProxy server = new ReportServerProxy();

                string reportServer = ConfigurationManager.AppSettings["ReportServer"];
                string instanceName = ConfigurationManager.AppSettings["ReportServerInstance"];

                // Get the server URL from the report server using WMI
                server.Url = AuthenticationUtilities.GetReportServerUrl(reportServer, instanceName);

                server.LogonUser(TxtUser.Text, TxtPwd.Text, null);

                passwordVerified = true;
            }
            catch (Exception ex)
            {
                lblMessage.Text = string.Format(CultureInfo.InvariantCulture, ex.Message);
                return;
            }
            if (passwordVerified == true)
            {
                lblMessage.Text = string.Format(CultureInfo.InvariantCulture,
                                                UILogon_aspx.LoginSuccess);
                string redirectUrl =
                    Request.QueryString["ReturnUrl"];
                if (redirectUrl != null)
                {
                    HttpContext.Current.Response.Redirect(redirectUrl, false);
                }
                else
                {
                    HttpContext.Current.Response.Redirect(
                        "./Folder.aspx", false);
                }
            }
            else
            {
                lblMessage.Text = string.Format(CultureInfo.InvariantCulture,
                                                UILogon_aspx.InvalidUsernamePassword);
            }
        }
        private void BtnLogon_Click(object sender, System.EventArgs e)
        {
            bool passwordVerified = false;
             try
             {
            ReportServerProxy server = new ReportServerProxy();

            string reportServer = ConfigurationManager.AppSettings["ReportServer"];
            string instanceName = ConfigurationManager.AppSettings["ReportServerInstance"];

            // Get the server URL from the report server using WMI
            server.Url = AuthenticationUtilities.GetReportServerUrl(reportServer, instanceName);

            server.LogonUser(TxtUser.Text, TxtPwd.Text, null);

            passwordVerified = true;

             }
             catch (Exception ex)
             {
            lblMessage.Text = string.Format(CultureInfo.InvariantCulture, ex.Message); ;
            return;
             }
             if (passwordVerified == true)
             {
            lblMessage.Text = string.Format(CultureInfo.InvariantCulture,
              UILogon_aspx.LoginSuccess);
            string redirectUrl =
               Request.QueryString["ReturnUrl"];
            if (redirectUrl != null)
               HttpContext.Current.Response.Redirect(redirectUrl, false);
            else
               HttpContext.Current.Response.Redirect(
                  "./Folder.aspx", false);
             }
             else
             {
            lblMessage.Text = string.Format(CultureInfo.InvariantCulture,
             UILogon_aspx.InvalidUsernamePassword);
             }
        }