随笔分类 -  ASP.NET

摘要:[一篮饭特稀原创,转载请注明出自http://www.cnblogs.com/wanghafan/p/4595084.html]在项目管理系统中出现查询工程明细出现CPU100%卡死症状:1.打开Profiler跟踪发现[f_GetProjectSum_Detail]函数卡死2.单独运行语句出现“数... 阅读全文
posted @ 2015-06-23 11:48 一篮饭特稀 阅读(556) 评论(0) 推荐(0)
摘要:[一篮饭特稀原创,转载请注明出自http://www.cnblogs.com/wanghafan/p/4554672.html]Win2003中IIS6部署Framework 4.5框架的MVC4项目,由于Win2003只能安装Framework4.0,因此需要做版本降级:1、调整项目的框架:右键工... 阅读全文
posted @ 2015-06-05 15:04 一篮饭特稀 阅读(3048) 评论(1) 推荐(0)
摘要:[一篮饭特稀原创,转载请注明出自http://www.cnblogs.com/wanghafan/p/3770779.html]*.aspx:1 2 3 4 5 6 7 8 9 *.aspx.cs:1 protected void btn_OK_Cli... 阅读全文
posted @ 2014-06-05 17:25 一篮饭特稀 阅读(3167) 评论(0) 推荐(0)
摘要:[一篮饭特稀原创,转载请注明出自http://www.cnblogs.com/wanghafan/p/3574154.html]现象:公有静态变量不可用于ASP.NET多用户操作,否则该变量会被多用户改写,导致错误。参考:http://blog.csdn.net/dobly/article/details/54826解决:可以使用public static Dictionary来实现多用户互斥操作。其中key存放唯一的用户登录ID,value存放数据内容。e.g.Global.aspx.cs: 1 public static class Global 2 { 3 public stat... 阅读全文
posted @ 2014-02-28 18:29 一篮饭特稀 阅读(940) 评论(2) 推荐(0)
摘要:[一篮饭特稀原创,转载请注明出自http://www.cnblogs.com/wanghafan/p/3284481.html]PostLogin :登录,并保存Cookie 1 public static string PostLogin(string postData, string requestUrlString, ref CookieContainer cookie) 2 { 3 ASCIIEncoding encoding = new ASCIIEncoding(); 4 byte[] data = encoding.GetBytes(po... 阅读全文
posted @ 2013-08-27 11:09 一篮饭特稀 阅读(3035) 评论(2) 推荐(0)
摘要:Page_preInit (常用)Page_Init (常用) 主要完成页面初始化时运行(只运行一次)Page_InitCompletePage_PreLoadpage_Load (常用) 页面读放内存时运行,每次都会初触发page_LoadCompleteButton_Clickpage_PreRender(常用)Page_PreRenderCompletePage_SaveStateComplete protected void Page_PreInit(object sender, EventArgs e) { Response.Write("我执行了Page_PreInit& 阅读全文
posted @ 2012-05-10 11:19 一篮饭特稀 阅读(277) 评论(1) 推荐(0)
摘要:单个文件的上传:保存到上传服务器指定目录: FileUpload1.Save(Server.MapPath("/upfiles/upload/") +FileUpload1.FileName);得到上传文件的文件名(含上传本地路径):FileUpload1.PostedFile.FileName;得到上传文件的大小:FileUpload1.PostedFile.ContentLength;得到上传文件上传类型:FileUpload1.PostedFile.ContentType;得到上传文件扩展名:System.IO.Path.GetExtension(FileUpload 阅读全文
posted @ 2012-05-10 11:18 一篮饭特稀 阅读(2155) 评论(0) 推荐(2)
摘要:FCKeditor是一款功能强大的开源在线文本编辑器(DHTML editor),使你在web上可以使用类似微软Word 的桌面文本编辑器的许多强大功能。FCKeditor目前的最新版本是2.6.3,本文以FCKeditor2.6.3介绍在asp.Net中的配置方法。FCKEditor官方下载地址:http://www.fckeditor.net/download在官方网站下载FCKeditor 2.6.3: FCKeditor_2.6.3.zipFCKeditor.Net :FCKeditor.Net_2.6.3.zip配置方法如下:一、删除不必要的文件从官方下载下来的FCKEditor2. 阅读全文
posted @ 2012-05-10 11:17 一篮饭特稀 阅读(139) 评论(0) 推荐(0)
摘要:1 <asp:Repeater ID="DataListTolData" runat="server"> 2 <HeaderTemplate> 3 <table name="mitab" border="1" align="center" style="border-collapse:collapse;width:98%;word-break: break-all;"> 4 <tr class="Toptr_bg" 阅读全文
posted @ 2012-05-10 11:16 一篮饭特稀 阅读(263) 评论(0) 推荐(0)
摘要:读取View Code 1 ConfigurationManager.AppSettings["isMail"]修改View Code 1 public static void SetValue(string path, string KeyName, string AppValue) 2 { 3 XmlDocument xDoc = new XmlDocument(); 4 xDoc.Load(path); 5 XmlNode xNode; 6 XmlElement xElem1; 7 xNode = xDoc.SelectSingleN... 阅读全文
posted @ 2012-05-10 11:12 一篮饭特稀 阅读(128) 评论(0) 推荐(0)
摘要:<meta http-equiv="pragma" content="no-cache" /><meta http-equiv="cache-control" content="no-cache" /><meta http-equiv="expires" content="0" /> 阅读全文
posted @ 2012-05-10 11:08 一篮饭特稀 阅读(139) 评论(0) 推荐(0)
摘要:调用:View Code 1 int width = 190;2 int height = 190;3 Bitmap source = new Bitmap("c:\\someimage.jpg");4 System.Drawing.Image thumb = source.GetThumbnailImage(width,height,null,IntPtr.Zero);5 thumb.Save("C:\\someimageshot.jpg");6 thumb.Dispose();函数:View Code 1 public static Bitmap C 阅读全文
posted @ 2012-05-10 11:05 一篮饭特稀 阅读(269) 评论(0) 推荐(0)
摘要:第一:private void Button1_Click(object sender, System.EventArgs e){ Response.Redirect(Request.Url.ToString())}第二:private void Button2_Click(object sender, System.EventArgs e){ Response.Write(" < script language=javascript>window.location.href=document.URL; < /script>")}第三:private 阅读全文
posted @ 2012-05-10 11:03 一篮饭特稀 阅读(159) 评论(0) 推荐(0)
摘要://本地路径转换成URL相对路径View Code 1 private string urlconvertor(string imagesurl1)2 {3 string tmpRootDir = Server.MapPath(System.Web.HttpContext.Current.Request.ApplicationPath.ToString());//获取程序根目录4 string imagesurl2 = imagesurl1.Replace(tmpRootDir, “”); //转换成相对路径5 imagesurl2 = imagesurl2.Replace(@”\“, @”/ 阅读全文
posted @ 2012-05-10 10:58 一篮饭特稀 阅读(1543) 评论(0) 推荐(0)
摘要:[一篮饭特稀原创,转载请注明出处http://www.cnblogs.com/wanghafan/archive/2012/05/10/2493864.html]js脚本正则判空和数字验证View Code 1 <script type="text/javascript"> 2 function CheckNullAndType() 3 { 4 var ErrorStr=''; 5 if($('#tb_FContractName').val().replace(/(^\s*)|(\s*$)/g, "")==&# 阅读全文
posted @ 2012-05-10 10:22 一篮饭特稀 阅读(342) 评论(0) 推荐(0)
摘要:Repeater 强制保留两位小数View Code 1 <asp:Repeater ID="Repeater1" runat="server" onitemdatabound="Repeater1_ItemDataBound"> 2 <HeaderTemplate> 3 <table class="tb_Content" border="0" cellpadding="0" cellspacing="1"> 4 < 阅读全文
posted @ 2012-05-07 17:43 一篮饭特稀 阅读(285) 评论(0) 推荐(0)
摘要:1 <SCRIPT> 2 function switchSysBar(){ 3 if (switchPoint.innerText==3) 4 { 5 switchPoint.innerText=4 6 document.all("frmTitle").style.display="none" 7 } 8 else 9 {10 switchPoint.innerText=311 document.all("frmTitle").style.display=""12 ... 阅读全文
posted @ 2012-02-09 17:02 一篮饭特稀 阅读(752) 评论(0) 推荐(1)
摘要:--CSS 弹出窗体后面的半透明效果style="filter:alpha(opacity=30)"--DIV高度最低不能为1px加上font-size:0px;因为DIV有个默认字体大小--position:absolutestyle="position:absolute;"加上这句,它修饰的对象会绝对服从后面left,top等的设置来定位对象位置。(相当于“浮起来”)去掉这句,它修饰的对象会自动匹配动态调整来定位对象位置。(相当于“沉下去”)--TextBox 极细边框BorderStyle="Solid" BorderColor 阅读全文
posted @ 2012-02-09 17:01 一篮饭特稀 阅读(294) 评论(0) 推荐(0)
摘要:--技巧 先对每个较大DIV的CSS样式设置 border:solid 1px blue 整体布局调整完再去掉1.先弄最外框的View Code 1 <div id="outterDiv">2 3 </div>2.马上加上CSSView Code 1 <style type="text/css">2 3 #outterDiv{ width:600px; }4 5 </style>3.分析布局左右结构View Code 1 <div class="InnerDiv">2 3 & 阅读全文
posted @ 2012-02-09 16:56 一篮饭特稀 阅读(393) 评论(0) 推荐(0)
摘要:1 <HTML><HEAD><TITLE>无标题文档</TITLE> 2 <META http-equiv=Content-Type content="text/html; charset=gb2312"> 3 <META content="MSHTML 6.00.2800.1264" name=GENERATOR> 4 <link href="css/css.css" rel="stylesheet" type="text/c 阅读全文
posted @ 2012-02-09 16:50 一篮饭特稀 阅读(618) 评论(0) 推荐(0)