随笔分类 -  C#

摘要:第 页 /共页 ' >首页 '>上一页 '>下一页 '>尾页 到第页 protected void FormView1_PageIndexChanging(object sender, FormViewPageEventArgs e) { FormView1.PageIndex = e.NewPageIndex; TextBox tb = (TextBox)FormView1.BottomPagerRow.FindControl("inPageNum"); tb.Text = (FormView1.PageIndex 阅读全文
posted @ 2013-09-29 15:18 Bluze 阅读(248) 评论(0) 推荐(0)
摘要:原因:Response.Write("");使用Response.Write输出脚本,破坏了,浏览器对CSS文件的加载;解决办法:将Response.Write改成 ClientScript.RegisterStartupScript(this.GetType(), "", ""); 阅读全文
posted @ 2013-09-25 16:28 Bluze 阅读(365) 评论(0) 推荐(0)
摘要:1、常用@Html.LabelFor(model => model.bmmc):@Html.EditorFor(model => model.bmmc)@Html.ValidationMessageFor(model => model.bmmc)2、新增属性 @Html.TextBoxFor(model => model.endyxq, new { @id = "tex1", @class = "easyui-datebox" })@Html.TextBoxFor(model => model.bmmc,new { @sty 阅读全文
posted @ 2013-09-22 10:14 Bluze 阅读(267) 评论(0) 推荐(0)
摘要:=Globals!PageNumber & "/" & Globals!TotalPages & "页"FormatDateTime类型函数——日期和时间 示例表达式=FormatDateTime(Fields!字段名.Value, DateFormat.ShortDate)=FormatDateTime(Fields!字段名.Value, vbShortDate) 阅读全文
posted @ 2013-08-28 14:16 Bluze 阅读(592) 评论(0) 推荐(0)
摘要:SharpMap是一个基于.net 2.0使用C#开发的Map渲染类库,可以渲染各类GIS数据(目前支持ESRI Shape和PostGIS格式),可应用于桌面和Web程序。其网址为:http://sharpmap.iter.dk/http://www.codeplex.com/SharpMap它的优点有:1、占用资源较少,响应比较快。在对于项目中如果只需要简单的地图功能的话,是一个比 较好的选择 。2、它是基于.NET 2.0环境下开发的,对于.NET环境支持较好。3、使用简单,只要在.NET项目中引用响应的dll文件即可,没有复杂的安装步骤。目前支持B/S及C/S两种方式的DLL调用,支持 阅读全文
posted @ 2013-08-19 11:12 Bluze 阅读(413) 评论(0) 推荐(0)
摘要:using Microsoft.Practices.EnterpriseLibrary.Caching;using Microsoft.Practices.EnterpriseLibrary.Caching.Expirations;ICacheManager cache = CacheFactory.GetCacheManager();PagedList _Product = (PagedList)cache["Product" + pageIndex.ToString()];if (_Product == null){ _Product = _db.Product.Ord 阅读全文
posted @ 2013-08-19 10:51 Bluze 阅读(341) 评论(0) 推荐(0)
摘要:pdf layout with xmlhttp://pdftemplate.codeplex.com/ 阅读全文
posted @ 2013-08-08 14:53 Bluze 阅读(289) 评论(0) 推荐(0)
摘要:var file = Request.Files["upload"];HSSFWorkbook hssfWorkbook = new HSSFWorkbook(file.InputStream);HSSFSheet sheet = (HSSFSheet)hssfWorkbook.GetSheetAt(0);System.Collections.IEnumerator rows = sheet.GetRowEnumerator();while (rows.MoveNext()){HSSFRow row = (HSSFRow)rows.Current;row.GetCell(1 阅读全文
posted @ 2013-08-08 10:20 Bluze 阅读(356) 评论(0) 推荐(0)
摘要:一、Webconfig 二、过滤的类public class GloalBugFilter : IExceptionFilter { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public GloalBugFilter() { } public void OnException(ExceptionContext filterCont... 阅读全文
posted @ 2013-08-08 09:23 Bluze 阅读(391) 评论(0) 推荐(0)
摘要:1简介1.1Log4net的优点:几乎所有的大型应用都会有自己的用于跟踪调试的API。因为一旦程序被部署以后,就不太可能再利用专门的调试工具了。然而一个管理员可能需要有一套强大的日志系统来诊断和修复配置上的问题。经验表明,日志记录往往是软件开发周期中的重要组成部分。它具有以下几个优点:它可以提供应用程序运行时的精确环境,可供开发人员尽快找到应用程序中的Bug;一旦在程序中加入了Log输出代码,程序运行过程中就能生成并输出日志信息而无需人工干预。另外,日志信息可以输出到不同的地方(控制台,文件等)以备以后研究之用。Log4net就是为这样一个目的设计的,用于.NET开发环境的日志记录包。1.2L 阅读全文
posted @ 2013-08-07 14:46 Bluze 阅读(416) 评论(0) 推荐(0)
摘要:MVC2里的拦截器接口(也叫过滤器接口):IActionFilter,IExceptionFilter,IResultFilter,并实现自己的拦截器。。。。1、IActionFilter(Action拦截器接口) Action拦截器分别在“执行Action之前”拦截和“执行Action之后”拦截,2个方法如下: // 摘要: // Called after the action method executes. // // 参数: // filterContext: // The f... 阅读全文
posted @ 2013-08-07 11:35 Bluze 阅读(664) 评论(0) 推荐(0)
摘要:GridView gdw = (GridView)sender; if (e.Row.RowIndex != -1) { int id = (gdw.PageSize * gdw.PageIndex) + e.Row.RowIndex + 1;//(页面索引)*(页面大小)+本页的行索引+1(从0开始编号,所以加1) string bsh = GridView1.DataKeys[e.Row.RowIndex].Values["BSH"].ToString(); 阅读全文
posted @ 2013-08-03 10:38 Bluze 阅读(283) 评论(0) 推荐(0)
摘要:1、asp:ButtonField模板中的行号获取前台代码:后台代码:if (e.CommandName == "lookcq") { int index = Int32.Parse(e.CommandArgument.ToString()); string autobh = GridView1.DataKeys[index].Values[""].ToString();}2、TemplateFiled模板中的行号获取前台代码: '/> 后台:if (e.CommandName == "zhuxiao") { strin 阅读全文
posted @ 2013-05-27 08:57 Bluze 阅读(327) 评论(0) 推荐(0)
摘要:Application word = new Application(); Document doc = null; if (word == null) { return; } word.Visible = false; word.DisplayAlerts = WdAlertLevel.wdAlertsNone; object path = Server.MapPath("..") + "\\Report\\xkcysqb.rtf"; object oMissing = System.Reflection.Missing.Value; doc = wo 阅读全文
posted @ 2013-05-22 09:30 Bluze 阅读(301) 评论(0) 推荐(0)
摘要:默认情况下,只有当包含 BoundField 对象的数据绑定控件处于只读模式时,格式化字符串才应用到字段值。若要在编辑模式中将格式化字符串应用到字段值,请将 ApplyFormatInEditMode 属性设置为 true。格式化字符串可以为任意字符串,并且通常包含字段值的占位符。例如,在格式化字符串“Item Value: {0}”中,当 BoundField 对象中显示字符串时,字段的值会代替 {0} 占位符。格式化字符串的剩余部分显示为文本。注意如果格式化字符串不包含占位符,则来自数据源的字段值将不包含在最终显示文本中。占位符由用冒号分隔的两部分组成并用大括号括起,格式为 {A : Bx 阅读全文
posted @ 2011-04-26 17:43 Bluze 阅读(853) 评论(0) 推荐(0)