随笔分类 - ASP.NET
ASP.NET for 3.5 or 2.0
摘要:在做项目时会用到Easyui datagrid插件,因为里面的数据各不相一,可能会存在内容无法撑开页面的效果,以下分享一下做得成功的一个案例,如图: 1 2 3 新增 4 5 6 7 8 9 10 11 1...
阅读全文
摘要:public class cl_file_upload : IHttpHandler{ public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"...
阅读全文
摘要:using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;namespace Mysqlserver{/// <summary>///
阅读全文
摘要:方法一:利用Httphandler实现URL重写(伪URL及伪静态)我们有时候会见到这样的地址:“http://www.huoho.com/show-12-34.html”,你或许认为在站点服务器根目录“/”下存在名为“show-12-34.html”的文件,其实实际它可能是不存在的,而可能你看到的内容是“/aspx/show.aspx?type= 12&id=34”的内容,为什么要这样做呢?原因有多个方面:首先是增强URL的友好性,记“show-12-34.html”总比 “/aspx/show.aspx?type=12&id=34”好记吧?其次就是方便搜索引擎收录,很多搜索
阅读全文
摘要:大家可在 MSDN 2003 中搜索一下 <sessionState> 即可看到关于 Web.config 中的<sessionState> 节点元素的描述,共有 Off、InProc、StateServer、SQLServer 四种模式。Off、InProc 分别指“不启用”、“进程内保存(默认值)”,此两种模式没啥讲的,所谓 InProc 就是把 Session 保存在 aspnet_wp.exe (Windows 2000 解析 ASP.NET页面所用的进程) 或 w3wp.exe (Win2003 的进程) 中,一旦进程被中止或被重置,Session 将丢失。一
阅读全文
摘要:固定表头方法:1,样式固定。这个方法是从网上参考的,但是忘记了来源,使用之后发现效果不是很好,有闪动。以下是源码(来源于网络):<styletype="text/css">.Freezing{position:relative;table-layout:fixed;top:expression(this.offsetParent.scrollTop);z-index:10;}.Freezingth{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding:2px;}</style&g
阅读全文
摘要:BackUpDB.aspxView Code 1 <div> 2 3 备份数据库:<asp:DropDownList ID="db" runat="server"> 4 </asp:DropDownList> 5 <br /> 6 <br /> 7 8 </div> 9 <div>10 11 备份名称和位置:<asp:TextBox ID="positions" runat="server"></asp:TextB
阅读全文
摘要:View Code 1 public static string getIP() 2 { 3 string result = String.Empty; 4 result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; 5 if (null == result || result == String.Empty) 6 { 7 result = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
阅读全文
摘要:View Code 1 public static string WeekDay()2 {3 string[] weekday = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };4 string week = weekday[Convert.ToInt32(DateTime.Now.DayOfWeek)];5 return week;6 }
阅读全文
摘要:View Code 1 public static int GetWeekTime(DateTime dt)2 {3 int ww = new System.Globalization.GregorianCalendar().GetWeekOfYear(dt, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Sunday);4 return ww;5 }
阅读全文
浙公网安备 33010602011771号