protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataSet dsItems = obQuoteRequest.Get_Quotation_Additional_Charge(UDFLib.ConvertToInteger(Request.QueryString["QuotationRequest_ID"])); DataTable dtItems = dsItems.Tables[0]; if (Convert.ToInt32(dtItems.Rows[0]["id"]) == 0) { ViewState["IsNew"] = true; gvItemList.DataSource = dtItems; gvItemList.DataBind(); } else { ViewState["IsNew"] = false; gvItemList.DataSource = dtItems; gvItemList.DataBind(); string CalculateTotal = String.Format("CalculateTotal();"); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "CalculateTotal", CalculateTotal, true); } string CurrentSts = dsItems.Tables[1].Rows[0]["currentStatus"].ToString(); if (CurrentSts == "NEW" || CurrentSts == "RFQ SENT" || CurrentSts == "QUOTE RECEIVED") { btnSaveItemDetails.Enabled = true; } else { btnSaveItemDetails.Enabled = false; } } }