コード例 #1
0
 protected void btnSearchComputer_Click(object sender, ImageClickEventArgs e)
 {
     ////Add Exception handilng try catch change by vishal 21-05-2012
     try
     {
         int count = 0;
         int temp  = 0;
         count = objasset.Get_Asset_By_Cname(txtsearchcompname.Text.ToString());
         if (count != 0)
         {
             temp                  = 1;
             Session["temp"]       = temp;
             Session["param_node"] = txtsearchcompname.Text.ToString();
             Response.Redirect("~/Asset/ViewAssetDetails.aspx");
         }
         else
         {
             string myScript;
             myScript = "<script language=javascript>alert('Computer not found!, Ensure that computer is in the Domain and User Login to the Domain.'); </script>";
             Page.RegisterClientScriptBlock("MyScript", myScript);
         }
     }
     catch (Exception ex)
     {
         string myScript;
         myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>";
         Page.RegisterClientScriptBlock("MyScript", myScript);
         return;
     }
 }