Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["ServerName"] != null &&
             Session["UName"] != null &&
             Session["Upwd"] != null &&
             !string.IsNullOrEmpty(Session["UName"].ToString().Trim()) &&
             !string.IsNullOrEmpty(Session["ServerName"].ToString().Trim()) &&
             !string.IsNullOrEmpty(Session["Upwd"].ToString().Trim()))
         {
             try
             {
                 getInfos = new GetDataBasesInfo(Session["ServerName"].ToString(), Session["UName"].ToString(), Session["Upwd"].ToString());
                 bindDataToTree();
             }
             catch (Exception ex)
             {
                 Response.Write("<script>alert('" + ex.Message + "')</script>");
                 Response.Redirect("index.aspx");
             }
         }
         else
         {
             Response.Redirect("index.aspx");
         }
     }
 }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["ServerName"] != null &&
             Session["UName"] != null &&
             Session["Upwd"] != null &&
             !string.IsNullOrEmpty(Session["UName"].ToString().Trim()) &&
             !string.IsNullOrEmpty(Session["ServerName"].ToString().Trim()) &&
             !string.IsNullOrEmpty(Session["Upwd"].ToString().Trim()))
         {
             try
             {
                 getInfos = new GetDataBasesInfo(Session["ServerName"].ToString(), Session["UName"].ToString(), Session["Upwd"].ToString());
                 bindDataToTree();
             }
             catch (Exception ex)
             {
                 Response.Write("<script>alert('" + ex.Message + "')</script>");
                 Response.Redirect("index.aspx");
             }
         }
         else
         {
             Response.Redirect("index.aspx");
         }
     }
 }