private void GetLateCheckin() { try { if (Session["propertyvalue"] != null) { string PropertyVale = Session["propertyvalue"].ToString(); gvLateCheckin.DataSource = tenants.GetLateCheckinRecord(PropertyVale); gvLateCheckin.DataBind(); } else { Session["propertyvalue"] = "0"; } } catch (Exception ex) { string errorMsg = ex.Message.ToString(); ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + errorMsg + "')</script>", false); } }