12 2011 档案

摘要:自动求和代码如下:protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex >= 0) { sum += Convert.ToInt32(e.Row.Cells[4].Text); } else if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[1].Text = "总分为:"; e.Row.Cells[2].Text = sum.ToString(); e. 阅读全文
posted @ 2011-12-30 11:04 kuangkro 阅读(2129) 评论(0) 推荐(0)
摘要:显示效果如图:后台代码如下:private void getDataBind() { DataTable dt = new DataTable(); dt.Columns.Add("id"); dt.Columns.Add("name"); dt.Columns.Add("location"); dt.Columns.Add("date"); if (dt.Rows.Count == 0) { dt.Rows.Add(dt.NewRow()); } this.GridView1.DataSource = dt; t 阅读全文
posted @ 2011-12-30 10:44 kuangkro 阅读(1734) 评论(2) 推荐(2)
摘要:<html><body><script>var arry=[1,2,3,4,5,6];alert((function(){for(var i=0,ret=arry[0]; i<arry.length; i++){ret = Math.max(ret,arry[i])}return ret;})());alert((function(){ return Math.max.apply(null,arry); })())</script> <input type="button" id="btnSubmit&q 阅读全文
posted @ 2011-12-26 16:33 kuangkro 阅读(349) 评论(0) 推荐(0)
摘要:.NET自带的分页控件代码如下:<asp:TemplateField HeaderText="序号"><ItemTemplate><%# Container.DataItemIndex + 1%></ItemTemplate></asp:TemplateField>如果自己写的分页类,一次只返回一页的数据,此时的需要就要跟分页的类关联了 :<asp:TemplateField HeaderText="序号"><ItemTemplate><%#pgCurrent.Pa 阅读全文
posted @ 2011-12-01 11:25 kuangkro 阅读(828) 评论(0) 推荐(0)