private void ibnLogout_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            FormsAuthentication.SignOut();

            string[] dirs = TemplateSourceDirectory.Split(new Char[] { (Char)0x2f });

            if (dirs[1].ToUpper().Equals("CDA")) //source dir is root
            {
                Response.Redirect("/Default.aspx");
            }
            else
            {
                Response.Redirect("/" + dirs[1] + "/Default.aspx");
            }
        }
        public void Page_Error(string error)
        {
            // Simple code to find root directory where edms.NET resides
            // Only supports 0 or 1 deep root directory
            string[] dirs = TemplateSourceDirectory.Split(new Char[] { (Char)0x2f });

            if (dirs[1].Equals("Administration")) // source dir is root
            {
                Response.Redirect("/Error.aspx?errmsg=" + HttpUtility.UrlEncode(error));
            }
            else if (dirs[1].Equals("CDA")) //source dir is root
            {
                Response.Redirect("/Error.aspx?errmsg=" + HttpUtility.UrlEncode(error));
            }
            else
            {
                Response.Redirect("/" + dirs[1] + "/Error.aspx?errmsg=" +
                                  HttpUtility.UrlEncode(error));
            }
        }