public void ShowData() { WebProject.BLL.BaseData.ZT_COM_NewsType bll_NewsType = new WebProject.BLL.BaseData.ZT_COM_NewsType(); DataSet ds = bll_NewsType.GetList(""); if (ds.Tables[0].Rows.Count > 0) { this.lblMessage.Visible = false; this.btnDeleteSelect.Visible = true; this.GridView1.Visible = true; this.GridView1.DataSource = ds; this.GridView1.DataBind(); } else { this.lblMessage.Visible = true; this.btnDeleteSelect.Visible = false; this.GridView1.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { string url = Request.Url.ToString(); if (CheckString.CheckSqlKeyWord(url) == true) { MessageBox.ShowAndRedirect(this, "你的IP地址为:" + Page.Request.UserHostAddress + ",请不要输入非法字段!", "Login.aspx"); } else { if (!this.IsPostBack) { if (Session["ZT_ADMIN"] == null) { Response.Redirect("Login.aspx"); } else { if (!Communal.CheckQx("NewsEdit.aspx")) { Response.Redirect("RightsWarn.aspx"); } else { WebProject.BLL.BaseData.ZT_COM_NewsType bll_NewsType = new WebProject.BLL.BaseData.ZT_COM_NewsType(); DataSet ds = bll_NewsType.GetList(" 1=1 "); BindData.BindDropDownList("NewsTypeName", "NewsTypeNo", ds, txtNewsType); this.txtNewsOrder.Attributes.Add("onpaste", "return false"); //屏蔽粘贴 ShowData(); } } } } }
protected void Page_Load(object sender, EventArgs e) { string url = Request.Url.ToString(); if (CheckString.CheckSqlKeyWord(url) == true) { MessageBox.ShowAndRedirect(this, "你的IP地址为:" + Page.Request.UserHostAddress + ",请不要输入非法字段!", "Login.aspx"); } else { if (!IsPostBack) { if (Session["ZT_ADMIN"] == null) { Response.Redirect("Login.aspx"); } else { if (!Communal.CheckQx("NewsList.aspx")) { Response.Redirect("RightsWarn.aspx"); } else { WebProject.BLL.BaseData.ZT_COM_NewsType bll_NewsType = new WebProject.BLL.BaseData.ZT_COM_NewsType(); DataSet ds = bll_NewsType.GetList(" 1=1 "); BindData.BindDropDownList("所有新闻", "ALL", "NewsTypeName", "NewsTypeNo", ds, txtNewsType); ShowData(this.txtNewsType.SelectedValue.ToString()); this.btnDeleteSelect.Attributes.Add("onclick", "return confirm('您确认要删除这些记录?');"); } } } } }