摘要: 我最新一直在和新手和入手级开发人员打交道,我注意到一些开发人员(甚至是老手)在粗心时常犯的错误。这些错误各不相同,从工具的使用到网络服务的适当应用都有。以下是六个主要的开发错误。 1.认为必须要用Visual Studio.NET来开发.NET应用 那些对微软.NET开发不了解的人误以为:利用.NET框架开发应用软件时必须要用到Visual Studio.NET。这并不正确。你只需安装可在... 阅读全文
posted @ 2008-02-07 23:52 一个IT愤青 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 1、首先下载一个ICO图标制作工具: Axialis IconWorkshop 6.10 简体中文企业版 制作图标如下: 32 X 32 和16 X 16均可。 2、在.aspx文件的部分添加如下代码: 其中rel必须为"shortcut icon",href是指ICO图标存放的位置,可以任意位置。 3、运行效果: 如果顺序是这样: ... 阅读全文
posted @ 2008-02-07 23:03 一个IT愤青 阅读(432) 评论(0) 推荐(0) 编辑
摘要: this.DropDownList1.Items.Insert(0, new ListItem("-请选择-", "0")); 阅读全文
posted @ 2008-02-07 16:07 一个IT愤青 阅读(3558) 评论(0) 推荐(0) 编辑
摘要: delete from 表名 where id in (select max(id) from 表名 group by name having count(*)>1) 一定要设置id为唯一主键,并设置自增列 阅读全文
posted @ 2008-02-07 16:03 一个IT愤青 阅读(4616) 评论(3) 推荐(0) 编辑
摘要: 此方法并非History.go(-1),因为History.go(-1)方法页面不会重新绑定 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ViewState["BackUrl"] = Request.UrlReferrer.To... 阅读全文
posted @ 2008-02-07 13:35 一个IT愤青 阅读(822) 评论(4) 推荐(1) 编辑
摘要: <asp:panel style="overflow-x:scroll;overflow-y:auto;"></asp:panel> 阅读全文
posted @ 2008-02-07 13:24 一个IT愤青 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 在页面加入如下代码 在FileUpload 里加入下面事件 阅读全文
posted @ 2008-02-07 13:21 一个IT愤青 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 在RowDataBand里: if (e.Row.Cells[2].Text=="1") { e.Row.Cells[2].Text = "允许"; } else { e.Row.Cells[2].Text = "不允许"; //e.Row.Cells[2].Visible = false; } 阅读全文
posted @ 2008-02-07 13:17 一个IT愤青 阅读(232) 评论(0) 推荐(0) 编辑
摘要: protected void btn_del_Click(object sender, EventArgs e) { //删除被选中的列 string sql = "delete from users where"; string cal = ""; for (int i = 0; i < GridView1.Rows.Co... 阅读全文
posted @ 2008-02-07 13:15 一个IT愤青 阅读(264) 评论(0) 推荐(0) 编辑
摘要: private double sum = 0;//取指定列的数据和,你要根据具体情况对待可能你要处理的是int protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex >= 0) { ... 阅读全文
posted @ 2008-02-07 13:08 一个IT愤青 阅读(640) 评论(0) 推荐(0) 编辑
摘要: 双击GridView的OnRowDataBound事件; 在后台的GridView1_RowDataBound()方法添加代码,最后代码如下所示: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex != -1) {... 阅读全文
posted @ 2008-02-07 13:06 一个IT愤青 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 双击GridView的OnRowDataBound事件; 在后台的GridView1_RowDataBound()方法添加代码,最后代码如下所示: protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRow... 阅读全文
posted @ 2008-02-07 13:05 一个IT愤青 阅读(304) 评论(2) 推荐(0) 编辑
摘要: DataNavigateUrlField="字段名" DataNavigateUrlFormatString="a.aspx?id={0}" 阅读全文
posted @ 2008-02-07 13:01 一个IT愤青 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Button1.Attributes.Add("onclick","return confirm('确认?')"); button.attributes.add("onclick","if(confirm('are you sure...?')){return true;}else{return false;}") 阅读全文
posted @ 2008-02-07 12:59 一个IT愤青 阅读(142) 评论(0) 推荐(0) 编辑
摘要: string strTime = DateTime.Now.ToShortDateString(); //获取短整型日期 string ip=this.Page.Request.UserHostAddress; //获取客户端IP 阅读全文
posted @ 2008-02-07 12:58 一个IT愤青 阅读(1078) 评论(4) 推荐(0) 编辑
摘要: 绑定时间,显示短日期格式,在这一列的属性里添加:DataFormatString="{0:d}" HtmlEncode="False" 阅读全文
posted @ 2008-02-07 12:55 一个IT愤青 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 一:在客户端执行 在GridView添加一列CheckBox模板列,在头模板也添加一个checkBox在CheckBox按钮事件上上添加 *************************************************************************** 二 在服务器端执行 在外部添加一个CheckBox按钮,并讲该按钮的AutoPostBac... 阅读全文
posted @ 2008-02-07 12:52 一个IT愤青 阅读(1894) 评论(1) 推荐(0) 编辑
摘要: [\d]{6}(19|20)*[\d]{2}((0[1-9])|(11|12))([012][\d]|(30|31))[\d]{3}[xX\d]* 阅读全文
posted @ 2008-02-07 12:33 一个IT愤青 阅读(159) 评论(0) 推荐(0) 编辑
摘要: protected void LinkButton1_Click(object sender, EventArgs e) { Response.ClearContent(); Response.AddHeader("content-disposition", "attachment; filename=MyExcelFile.xls"); ... 阅读全文
posted @ 2008-02-07 12:32 一个IT愤青 阅读(155) 评论(0) 推荐(0) 编辑