移除IIS响应中不需要的信息

ASP.NET 2260 次浏览
1.移除:X-AspNet-Version 在web.config中加入该行代码。 2.移除:X-AspNetMvc-Version 在Global.asax.cs文件中加入 protectedvoidApplication_Start() { MvcHandler.DisableMvcResponseHeader=true; } 3.移除或修改:Server 在工程中加入一个module类...

修复kindeditor编辑器中追加内容滚动条往上顶的bug

ASP.NET 2406 次浏览
kindeditor编辑器中追加内容滚动条往上顶的bug无论滚动条拉到什么地方,一复制粘贴,插入图片,等操作,就会跑到最顶部,所以操作起来很不方便,各位有没有知道这个问题怎么解决??? 遇到这个问题是因为使用了br换行引起的。默认使用p标签换行没有这个bug 因为加了换行符号的原因newlineTag:‘br’, KindEditor.ready(function(K){ editor=K.c...

常见文件MIME类型

ASP.NET 2172 次浏览
常见文件MIME类型 .asx,video/x-ms-asf .xml,text/xml .tsv,text/tab-separated-values .ra,audio/x-pn-realaudio .sv4crc,application/x-sv4crc .spc,application/x-pkcs7-certificates .pmc,application/x-perfmon .lit,...

ASP.NET 读写Webconfig的AppSetting和ConnectionString

ASP.NET 2136 次浏览
usingSystem.Configuration; usingSystem.Web; usingSystem.Web.Configuration; namespaceRC.Website.Webservice.Controllers { /// ///ASP.NET配置文件写辅助类 /// publicclassConfigurationHelper { /// ///读取链接字符串 /// ...

APS.NET MVC 对输出HTML源码进行压缩

ASP.NET-MVC 3054 次浏览
增加一个Controller基类,用于压缩输出的HTML源代码,需要压缩的Controller继承自这个基类即可。 思路:对输出html内容里的空格回车换行符等进行移除。 如果js结尾不写分号的话,压缩后,页面脚本会受影响,按标准写的代码不会有影响,目前在我自己的项目中使用,尚未发现什么问题。 usingSystem.IO; usingSystem.Te...

WebRequest同时Post提交图片和字段信息

ASP.NET-MVC 3276 次浏览
1.封装好的方法: publicstringHttpUploadFile(stringurl,stringfile,stringparamName,stringcontentType,NameValueCollectioncollection) { varresult=string.Empty; varboundary="--------------------------...

从 HTTP 到 HTTPS - IIS 部署免费 HTTPS

ASP.NET-MVC 2985 次浏览
一、有哪些免费证书 这里只介绍部署HTTPS中尝试的免费证书方案,部署在IIS8上。 Let'sEncrypt 沃通(wosign)(不推荐) 本来在迁移中尝试部署过沃通(wosign)的签发的免费证书,但是后来发现了Mozilla官网(firefox/火狐背后的开源组织)里列出了沃通的一系列可疑行为和问题,并且沃通"秘密"收购StartCom(著名的免费HTTPS...

customErrors和httpErrors的区别

ASP.NET-MVC 3013 次浏览
ThecustomErrorsattributeisusedwhenthe.netcodeisthrowinganexception(404,403,500etc)and thehttpErrorsattributeisusedwhenIISitselfisthrowinganexception. SoforexampleIhaveasimplemvcwebapplication,Idefin...