protected void Page_Load(object sender, EventArgs e) {/////Add Exception handilng try catch change by vishal 21-05-2012 try { string username = (string)(Session["Username"]); string usersess = (string)(Session["Us"]); Session["UName"] = usersess; Session["Username"] = usersess; int flag1 = 0; if (username == null) { lblusername.Text = ""; } else { lblusername.Text = username.ToString(); } //lblErrorMsg.Text = ""; if (!IsPostBack) { col = ObjAsset.Get_NotAssign_By_comandname(""); grdvwViewAsset.DataSource = col; grdvwViewAsset.DataBind(); ViewState["commandname"] = ""; } } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
protected void Page_Load(object sender, EventArgs e) { /////Add Exception handilng try catch change by vishal 21-05-2012 try { this.ClientScript.GetPostBackEventReference(this, "arg"); // Values for SelectAsset Page after select the asset for a particular user int flag = Convert.ToInt32(Session["flag2"]); if (flag == 1) { string username; userid = Convert.ToInt32(Session["userid"]); username = (string)(Session["username"]); txtusername.Text = username.ToString(); Session["flag2"] = "0"; } lblErrorMsg.Text = ""; if (!IsPostBack) { //string name; //if (txtname.Text == "") //{ // ViewState["commandname"] = ""; //} //else //{ // name = txtname.Text.ToString(); // col = ObjAsset.Get_By_comandname(name); // grdvwViewAsset.DataSource = col; // grdvwViewAsset.DataBind(); // ViewState["commandname"] = name; //} // col = ObjAsset.Get_By_comandname(""); col = ObjAsset.Get_NotAssign_By_comandname(""); grdvwViewAsset.DataSource = col; grdvwViewAsset.DataBind(); } } catch (Exception ex) { string myScript; myScript = "<script language=javascript>alert('Exception - '" + ex + "');</script>"; Page.RegisterClientScriptBlock("MyScript", myScript); return; } }
protected void Page_Load(object sender, EventArgs e) { this.ClientScript.GetPostBackEventReference(this, "arg"); // Values for SelectAsset Page after select the asset for a particular user int flag = Convert.ToInt16(Session["flag2"]); if (flag == 1) { string username; userid = Convert.ToInt16(Session["userid"]); username = (string)(Session["username"]); txtusername.Text = username.ToString(); Session["flag2"] = "0"; } lblErrorMsg.Text = ""; if (!IsPostBack) { //string name; //if (txtname.Text == "") //{ // ViewState["commandname"] = ""; //} //else //{ // name = txtname.Text.ToString(); // col = ObjAsset.Get_By_comandname(name); // grdvwViewAsset.DataSource = col; // grdvwViewAsset.DataBind(); // ViewState["commandname"] = name; //} // col = ObjAsset.Get_By_comandname(""); col = ObjAsset.Get_NotAssign_By_comandname(""); grdvwViewAsset.DataSource = col; grdvwViewAsset.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { string username = (string)(Session["Username"]); int flag1 = 0; if (username == null) { lblusername.Text = ""; } else { lblusername.Text = username.ToString(); } //lblErrorMsg.Text = ""; if (!IsPostBack) { col = ObjAsset.Get_NotAssign_By_comandname(""); grdvwViewAsset.DataSource = col; grdvwViewAsset.DataBind(); ViewState["commandname"] = ""; } }