摘要: 【原型模式】: 用原型实例指定创建对象的种类,并且通过拷贝这些原型创建新的对象。适用性当要实例化的类是在运行时刻指定时,例如,通过动态装载;或者为了避免创建一个与产品类层次平行的工厂类层次时;或者当一个类的实例只能有几个不同状态组合中的一种时。建立相应数目的原型并克隆它们可能比每次用合适的状态手工实例化该类更方便一些。【实现代码】usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceConsoleApplication1{//原型模式:其实就是从一个对象再创建另一个可制定的对 阅读全文
posted @ 2009-08-18 16:04 清山博客 阅读(177) 评论(0) 推荐(0)
摘要: ASP.NET生成静态页面,效果图如下:1.模板样式:2.添加内容:3.生成的静态页面:实现代码: //“发表”按钮 protected void BtnPublic_Click(object sender, EventArgs e) { string title = TextBox1.Text; string body = WebEditor1.Text; string datetime = DateTime.Now.ToShortDateString(); string[] strNewHtml = { title, ... 阅读全文
posted @ 2009-08-18 15:49 清山博客 阅读(213) 评论(0) 推荐(0)
摘要: ASP.NET网页文本编辑器的使用,效果图如下:这里要用到DotNetTextBox.dll组件,具体内容可以在http://sites.google.com/site/zhangqs008/chang-yong-gong-ju 下载,使用方法如下:1.将“DotNetTextBox.dll”文件添加到工具箱。2.将“Skin”文件夹,复制到当前目录下,请注意,一定是“当前目录“; 如果你的网站有多个目录,那么就将该文件夹放到要使用文本编辑器的目录下;3.注意将要使用的页面的属性(一般就是页面第一行)的 ValidateRequest值设为false;比如:<%@ Page Langua 阅读全文
posted @ 2009-08-18 10:15 清山博客 阅读(190) 评论(0) 推荐(0)
摘要: 上传多个文件,效果图如下:前台代码和JavaScript脚本: <mce:script type="text/javascript"><!-- function AddFile() { var strFile='<input name="File1" type="file" /></br>'; document.getElementById("DivFile").insertAdjacentHTML("beforeEnd",strFile 阅读全文
posted @ 2009-08-18 09:58 清山博客 阅读(235) 评论(0) 推荐(0)
摘要: GridView中删除一列时,弹出询问对话框,如下图所示:后台代码:protected void GridUsers_RowDataBound(object sender, GridViewRowEventArgs e) { if(e.Row.Cells[0].HasControls()) { LinkButton BtnDelete = (LinkButton)e.Row.Cells[0].Controls[2]; LinkButton BtnUpdate = (LinkButton)e.Row.Cells[0].... 阅读全文
posted @ 2009-08-18 09:30 清山博客 阅读(370) 评论(0) 推荐(0)