摘要: Many developers have had to write a loop that writes out a comma separated value list. There's always the trick of how you make that last comma get removed from the end of that string. Usually, at t... 阅读全文
posted @ 2007-11-02 18:21 Fernando 阅读(599) 评论(0) 推荐(0) 编辑
摘要: 这三个方法用于删除字符串头尾出现的某些字符。Trim()删除字符串头部及尾部出现的空格,删除的过程为从外到内,直到碰到一个非空格的字符为止,所以不管前后有多少个连续的空格都会被删除掉。TrimStart()只删除字符串的头部的空格。TrimEnd()只删除字符串尾部的空格。 如果这三个函数带上字符型数组的参数,则是删除字符型数组中出现的任意字符。如Trim("abcd".To... 阅读全文
posted @ 2007-11-02 17:22 Fernando 阅读(709) 评论(0) 推荐(0) 编辑
摘要: 在使用FormView或则DetailsView时,经常会遇到记录为空的情况,那这时如果能改为插入模式,用户体验会非常的好。 1. 把DetailsView的默认模式改为Insert模式; 2. 加入以下代码: //当GridView中的行被选中后,使DetailsView改为ReadOnly模式 protected void GridView1_SelectedIndexChan... 阅读全文
posted @ 2007-11-02 15:28 Fernando 阅读(967) 评论(0) 推荐(0) 编辑
摘要: Page 执行中将按照如下顺序激活事件: Page.PreInit Page.Init Page.InitComplite Page.PreLoad Page.Load Page.LoadComplete Page.PreRender Page.PreRenderComplete 如果页面从令一个页面继承,如BasePage:System.Web.UI.Page,在BasePage中做了一些扩... 阅读全文
posted @ 2007-11-02 14:54 Fernando 阅读(220) 评论(0) 推荐(0) 编辑
摘要: //删除店铺之前,先把相关的分类数据从数据库中删除 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { int dietStoreID = Convert.ToInt32(e.Keys[0]); DietStoreClassDetai... 阅读全文
posted @ 2007-11-02 11:46 Fernando 阅读(2625) 评论(2) 推荐(0) 编辑
摘要: 介绍 我们可以通过控制HeaderStyle, RowStyle, AlternatingRowStyle和其他一些属性来改变GridView, DetailsView, 和 FormView的样式,比如cssClass, Font, BorderWidth, BorderStyle, BorderColor, Width, Height等 一般,自定义格式化与我们所要显示的数据的值有关系。例... 阅读全文
posted @ 2007-11-02 10:47 Fernando 阅读(320) 评论(0) 推荐(0) 编辑