protected void Page_Load(object sender, EventArgs e) { UnobtrusiveValidationMode = System.Web.UI.UnobtrusiveValidationMode.None; //if (Session["userID"] != null) //{ // custID = (int)Session["userID"]; // lblTotal.Text = PackageDB.GetSum(custID); //} //else //{ Session["userID"] = 104; custID = Convert.ToInt32(Session["userID"]); lblTotal.Text = String.Format(": {0:C}", Convert.ToDecimal(PackageDB.GetSum(custID))); //Response.Redirect("Login.aspx"); // } }
protected void Page_Load(object sender, EventArgs e) { UnobtrusiveValidationMode = System.Web.UI.UnobtrusiveValidationMode.None; if (Session["userID"] != null) { custID = (int)Session["userID"]; if (PackageDB.GetSum(custID) != "") { lblTotal.Text = String.Format(": {0:C}", Convert.ToDecimal(PackageDB.GetSum(custID))); } else { lblTotal.Text = ": $0.00"; } } else { //Session["userID"] = 104; //custID = Convert.ToInt32(Session["userID"]); //lblTotal.Text = String.Format(": {0:C}",Convert.ToDecimal(PackageDB.GetSum(custID))); Response.Redirect("Login.aspx"); } }