您目前尚未登陆,请选择【登陆】或【注册
首页->博客论坛->BlogEngine v1.3 多皮肤多语言版源码>>admin/Pages/PingServices.aspx.cs>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:BlogEngine v1.3 多皮肤多语言版源码


当前文件路径:BlogEngine/admin/Pages/PingServices.aspx.cs 文件类型
普通视图
		            
1Using 13 14public partial class admin_Pages_PingServices : System.Web.UI.Page 15{ 16 protected void Page_Load(object sender, EventArgs e) 17 { 18 if (!Page.IsPostBack) 19 { 20 BindGrid(); 21 } 22 23 grid.RowEditing += new GridViewEditEventHandler(grid_RowEditing); 24 grid.RowUpdating += new GridViewUpdateEventHandler(grid_RowUpdating); 25 grid.RowCancelingEdit += delegate { Response.Redirect(Request.RawUrl); }; 26 grid.RowDeleting += new GridViewDeleteEventHandler(grid_RowDeleting); 27 btnAdd.Click += new EventHandler(btnAdd_Click); 28 btnAdd.Text = Resources.labels.add + " ping service"; 29 } 30 31 void btnAdd_Click(object sender, EventArgs e) 32 { 33 StringCollection col = BlogService.LoadPingServices(); 34 string service = txtNewCategory.Text.ToLowerInvariant(); 35 if (!col.Contains(service)) 36 { 37 col.Add(service); 38 BlogService.SavePingServices(col); 39 } 40 Response.Redirect(Request.RawUrl); 41 } 42 43 void grid_RowDeleting(object sender, GridViewDeleteEventArgs e) 44 { 45 string service = grid.DataKeys[e.RowIndex].Value.ToString(); 46 StringCollection col = BlogService.LoadPingServices(); 47 col.Remove(service); 48 BlogService.SavePingServices(col); 49 Response.Redirect(Request.RawUrl); 50 } 51 52 void grid_RowUpdating(object sender, GridViewUpdateEventArgs e) 53 { 54 string service = grid.DataKeys[e.RowIndex].Value.ToString(); 55 TextBox textbox = (TextBox)grid.Rows[e.RowIndex].FindControl("txtName"); 56 57 StringCollection col = BlogService.LoadPingServices(); 58 col.Remove(service); 59 col.Add(textbox.Text.ToLowerInvariant()); 60 BlogService.SavePingServices(col); 61 62 Response.Redirect(Request.RawUrl); 63 } 64 65 void grid_RowEditing(object sender, GridViewEditEventArgs e) 66 { 67 grid.EditIndex = e.NewEditIndex; 68 BindGrid(); 69 } 70 71 private void BindGrid() 72 { 73 StringCollection col = BlogService.LoadPingServices(); 74 StringDictionary dic = new StringDictionary(); 75 foreach (string services in col) 76 { 77 dic.Add(services, services); 78 } 79 80 grid.DataKeyNames = new string[] { "key" }; 81 grid.DataSource = dic; 82 grid.DataBind(); 83 } 84 85} 86
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:BlogEngine v1.3 多皮肤多语言版源码

- 面向对象实例之数据操作项目源码

- B2C电子商务网站系统源码

- Asp.net简单入门新闻系统51a..

- Asp.net三层结构入门示例源码

- XproerBBS1.1(Access数据库)..

- MagicAjax入门程序之无刷新显..

- AjaxControlToolkit之Tabs控..

- 大学生调查投票系统源码

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号