随笔分类 -  ASP.NET

ASP.NET
摘要:在客户的服务器上,发现响应头上Content-Length为0,在其他的环境不能重现这个问题。 通过Fidder抓包发现:Transfer-Encoding: chunked,使用了分包传输,Content-Length为0了。 问题:是什么原因导致了Transfer-Encoding: chunk 阅读全文
posted @ 2022-06-07 17:19 虎头 阅读(4858) 评论(0) 推荐(1) 编辑
摘要:在运维工作中,经常能接到客户的反馈这个:引发类型为“System.OutOfMemoryException”的异常。客户反馈物理内存都还有富余,怎么报内存不足的错误呢! 什么时候会引发System.OutOfMemoryException:操作系统无法满足GC对连续内存块的请求,则会发生System 阅读全文
posted @ 2018-10-31 11:23 虎头 阅读(106559) 评论(0) 推荐(2) 编辑
摘要:当我们把网站部署在IIS7或IIS6S的时候,每当IIS或是Application Pool重启后,第一次请求网站反应总是很慢,原因大家都知道(不知道可以参考这个动画说明ASP.NET网页第一个Request会比较慢的原因)。所以每次网站更新都会给第一个用户代号不好的用户体验,因此之前大家得通过撰写 阅读全文
posted @ 2017-08-15 09:04 虎头 阅读(1637) 评论(0) 推荐(0) 编辑
摘要:调用webservice时提示对操作的回复消息正文进行反序列化时出错。主要原因webservice返回值的长度超过readerQuotas中的了maxStringContentLength值,造成返回值截断,不完整,反序列化时出错。 <readerQuotas maxDepth="32" maxStringContentLength="81920" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384&q 阅读全文
posted @ 2012-09-27 20:04 虎头 阅读(1175) 评论(0) 推荐(0) 编辑
摘要:Web service的默认的请求长度是4M当内容超过了4M会报错System.Web.Services.Protocols.SoapException: 运行配置文件中指定的扩展时出现异常。 ---> System.Web.HttpException: 超过了最大请求长度。 在 System.Web.HttpRequest.GetEntireRawContent() 在 System.Web.HttpRequest.get_InputStream() 在 System.Web.Services.Protocols.SoapServerProtocol.Initialize() ... 阅读全文
posted @ 2012-09-24 14:04 虎头 阅读(7411) 评论(0) 推荐(0) 编辑
摘要:在IE和Firefox下,动态创建元素的方法是由区别的如下面代码,在IE下可以运行,在Firefox下会报错var theform = document.forms[0];theform.appendChild(document.createElement("<input type='hidden' name='__EVENTTARGET'>"));在 Firefox 只支持:document.createElement('input')如果添加属性和事件的话,需要使用setAttribute方法使用jquery动 阅读全文
posted @ 2012-03-28 13:22 虎头 阅读(22503) 评论(0) 推荐(0) 编辑
摘要:WebForm_DoPostBackWithOptions是asp.net2.0新增的一个函数,对__doPostBack进行了封装下面两种情况下会生成WebForm_DoPostBackWithOptions第一种情况:页面使用了验证控件,并且控件的CausesValidation为true第二种情况:控件设置了PostBackUrl属性 阅读全文
posted @ 2012-03-28 11:37 虎头 阅读(438) 评论(0) 推荐(0) 编辑
摘要:asp.net有两种方法引发回传1、通过button,ImageButton直接引发回传2、其他控件通过__doPostBack 函数引发回传具体原理如下一、Button和ImageButton直接引发回传,当在这两种控件上触发事件时,控件的ID会作为参数传给服务器,从而使服务器得知该映射到哪个后端事件1、Default.aspx<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true&qu 阅读全文
posted @ 2012-03-28 11:02 虎头 阅读(4587) 评论(1) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Web;using Newtonsoft.Json;namespace Xys.PetShop.Web{ public class Cookie<T> { public static void SetCookie(string name, T tValue, DateTime expires) { string value=JsonConvert.SerializeObject(tValue); HttpCookie cookie 阅读全文
posted @ 2012-03-02 15:04 虎头 阅读(345) 评论(0) 推荐(0) 编辑
摘要:使用NuGet安装EntityFrameWork4.21、下载NuGet有两种方式下载NuGet第一种:在微软的档案库下载,下载地址为:http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c?SRC=VSIDE弟二种:在vs2010的Tools中Extension Manager-》OnlineGallery 中搜索NuGet并下载安装2、安装NuGet在安装NuGet时,遇到了一个错误Error: The Package Manager Console requires PowerS 阅读全文
posted @ 2012-01-11 15:59 虎头 阅读(5271) 评论(0) 推荐(0) 编辑
摘要:1、Net名称准则参考:http://msdn.microsoft.com/zh-cn/library/ms229002.aspx2、代码编码规则检查工具StyleCop:http://stylecop.codeplex.com/releases/view/79972SourceAnalysis (StyleCop)不是代码格式化(代码美化)工具,而是代码规范检查工具(Code Review 工具),它不仅仅检查代码格式,而是编码规范,包括命名和注释等。Microsoft StyleCop 不提供你自己进行编码规则详细定义的控制功能,但是你可以用开关的方式设置某一个设置项是否要启用,在解决方案 阅读全文
posted @ 2012-01-10 16:49 虎头 阅读(296) 评论(1) 推荐(0) 编辑
摘要:1、CookieModule的实现using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Security;namespace HttpModule{ public class CookieModule : IHttpModule { public CookieModule() { // // TODO: Add constructor logic here ... 阅读全文
posted @ 2011-12-12 16:08 虎头 阅读(766) 评论(0) 推荐(0) 编辑
摘要:参考ASP.NET 页生命周期概述:http://msdn.microsoft.com/zh-cn/library/ms178473%28VS.80%29.aspxASP.NET 应用程序生命周期概述:http://msdn.microsoft.com/zh-cn/library/ms178472%28VS.80%29.aspx 阅读全文
posted @ 2011-12-12 09:25 虎头 阅读(208) 评论(0) 推荐(0) 编辑
摘要:详情参考:http://msdn.microsoft.com/zh-cn/library/ms143327.aspx在 searchPattern 中允许使用以下通配说明符。通配符说明*零个或多个字符。?正好一个字符。 阅读全文
posted @ 2011-09-22 09:09 虎头 阅读(505) 评论(0) 推荐(0) 编辑
摘要:1、web.config配置文件<?xml version="1.0" encoding="utf-8" ?><configuration> <configSections> <section name="log" type="Xys.PetShop.Framework.Configuration.LogConfigurationSetion,Xys.PetShop.Framework"/> </configSections> <log> &l 阅读全文
posted @ 2011-09-21 16:20 虎头 阅读(1739) 评论(0) 推荐(0) 编辑
摘要:1. 取交集 (A和B都有)List A : { 1 , 2 , 3 , 5 , 9 }List B : { 4 , 3 , 9 } var intersectedList = list1.Intersect(list2);结果 : { 3 , 9 }判断A和B是否有交集 bool isIntersected = list1.Intersect(list2).Count() > 02. 取差集 (A有,B沒有)List A : { 1 , 2 , 3 , 5 , 9 }List B : { 4 , 3 , 9 }var expectedList = list1.Except(list2) 阅读全文
posted @ 2011-09-06 17:54 虎头 阅读(15138) 评论(2) 推荐(2) 编辑
摘要:private CookieContainer GetCookies() { CookieContainer myCookieContainer = new CookieContainer(); HttpCookie requestCookie; int requestCookiesCount = Request.Cookies.Count; for (int i = 0; i < requestCookiesCount; i++) { requestCookie = Request.Cookies[i]; Cookie clientCookie = new Cookie(request 阅读全文
posted @ 2011-09-06 14:53 虎头 阅读(8273) 评论(1) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Web.UI;using System.Web.UI.WebControls;namespace Xys.Remp.WF.UI{ public class WorkFlowTraceTemplate : ITemplate { ListItemType templateType; public WorkFlowTraceTemplate(ListItemType type) { templateType = 阅读全文
posted @ 2011-08-19 10:39 虎头 阅读(1357) 评论(1) 推荐(2) 编辑
摘要:在现实应用中,对于集合以及枚举这些集合的需求非常普遍, 因此在.NET中集合所依赖的接口被设计为公共的。想要实现对象的枚举就必须继承IEnumerable接口。public interface IEnumerable{ public IEnumerator GetEnumerator();}它只有一个成员:GetEnumerator方法。该方法返回一个世纪的枚举器(enumerator)对象。那么要定义一个枚举器就要必须实现IEnumrator接口:public interface IEnumerator{ public Boolean MoveNext(); public Object Cu 阅读全文
posted @ 2011-08-08 15:11 虎头 阅读(501) 评论(1) 推荐(0) 编辑
摘要:这个异常的核心点在于生成的动态的生成脚本没有正常解析这么找到这个错误的脚本地址,用httpwatch查看一下发现 http://localhost:8216/WebResource.axd?d=_xqoAC_y7luLaqnRFtp75Q2&t=634364706260000000 的result为500,通过IE打开,发现报一个异常最后检查是服务器的时间被修改了,比正常的时间慢了2年还有的是因为axd映射没加上解决办法:将.axd映射加上。但“检查文件是否存在”不能选择。1、确保版本对应,检查.net版本 是1.1.4322 还是 2.0.50727.确保您的网站是在正确环境下运行。 阅读全文
posted @ 2011-06-26 09:43 虎头 阅读(472) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示