您目前尚未登陆,请选择【登陆】或【注册
首页->电子商务->明日供求信息网源码>>BackGround/DeleteInfo.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:明日供求信息网源码
当前文件:文件类型 MingriGongQiu/BackGround/DeleteInfo.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Data; 3using System.Configuration; 4using System.Collections; 5using System.Web; 6using System.Web.Security; 7using System.Web.UI; 8using System.Web.UI.WebControls; 9using System.Web.UI.WebControls.WebParts; 10using System.Web.UI.HtmlControls; 11 12public partial class BackGround_DeleteInfo : System.Web.UI.Page 13{ 14 Operation operation = new Operation(); //业务类对象 15 static string infoType = "";      //供求信息类型 16 17 protected void Page_Load(object sender, EventArgs e) 18 { 19 if (!IsPostBack) 20 { 21 infoType = Request.QueryString["id"].ToString(); 22 GridViewBind(infoType); 23 } 24 } 25 /// <summary> 26 /// 绑定供求信息到GridViev控件 27 /// </summary> 28 /// <param name="type">供求信息类别</param> 29 private void GridViewBind(string type) 30 { 31 GridView1.DataSource = operation.SelectInfo(type); 32 GridView1.DataKeyNames = new string[] { "id" }; 33 GridView1.DataBind(); 34 //显示当前页数 35 lblPageSum.Text = "当前页为 " + (GridView1.PageIndex + 1) + " / " + GridView1.PageCount + " 页"; 36 } 37 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 38 { 39 if (e.Row.RowType == DataControlRowType.DataRow) 40 { 41 //高亮显示指定行 42 e.Row.Attributes.Add("onMouseOver", "Color=this.style.backgroundColor;this.style.backgroundColor='#FFF000'"); 43 e.Row.Attributes.Add("onMouseOut", "this.style.backgroundColor=Color;"); 44 //设置审核状态,并且设置相应的颜色。 45 if (e.Row.Cells[5].Text == "False") 46 { 47 e.Row.Cells[5].Text = StringFormat.HighLight("未审核", true); 48 } 49 else 50 { 51 e.Row.Cells[5].Text = StringFormat.HighLight("已审核", false); 52 } 53 //多余字 使用...显示 54 e.Row.Cells[2].Text = StringFormat.Out(e.Row.Cells[2].Text, 18); 55 //删除指定行数据时,弹出询问对话框 56 ((LinkButton)(e.Row.Cells[7].Controls[0])).Attributes.Add("onclick", "return confirm('是否删除当前行数据!')"); 57 } 58 } 59 protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) 60 { 61 string id = GridView1.DataKeys[e.NewSelectedIndex].Value.ToString(); 62 Response.Write("<script> window.open('DetailInfo.aspx?id=" + id + "&&type=" + infoType + "','','height=258,width=679,top=200,left=200') </script>"); 63 Response.Write("<script>history.go(-1)</script>"); 64 } 65 protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) 66 { 67 GridView1.PageIndex = e.NewPageIndex; 68 GridViewBind(infoType); 69 } 70 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) 71 { 72 operation.DeleteInfo(GridView1.DataKeys[e.RowIndex].Value.ToString()); 73 GridViewBind(infoType); 74 } 75} 76
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:明日供求信息网源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号