04 2015 档案

解决 Failed to generate the sample for media type 'application/x-www-form-urlencoded'.
摘要:Asp.net MVC WebAPI 生成帮助文档时对于API的参数是自定义类型的会遇到本错误。API.Areas.HelpPage.HelpPageConfig 的Register 方法中 可以将以下代码注释去掉以消除该错误。//// Uncomment the following to use ... 阅读全文

posted @ 2015-04-24 16:24 leonworld2011 阅读(1302) 评论(0) 推荐(0) 编辑

MVC 中的 Url.Content
摘要:Url.Content 可以用来生成网站中的路径,包括图像,文件地址的路径。Content方法并不是MVC 网站下“Content”目录。该方法会携带网站部署时的虚拟路径。假如网站 A 有以下路径 A/B/C, B 和 C 都是虚拟目录。则在C中 可以使用 Url.Content("~/Conten... 阅读全文

posted @ 2015-04-23 15:35 leonworld2011 阅读(708) 评论(0) 推荐(0) 编辑

Powershell 中 catch webexception
摘要:powershelltry{ $resp = $r.GetResponse() $reqstream = $resp.GetResponseStream() $sr = new-object System.IO.StreamReader $reqstream... 阅读全文

posted @ 2015-04-20 10:58 leonworld2011 阅读(546) 评论(0) 推荐(0) 编辑

在Asp.net WebForm 项目中添加WebAPI
摘要:WebAPI 可以独立于MVC存在。 可以通过如下方法加入到WebForm项目中:在项目引用中添加以下dll:System.Net.HttpSystem.Net.Http.FormattingSystem.Web.ExtensionsSystem.Web.HttpSystem.Web.Http.We... 阅读全文

posted @ 2015-04-14 15:57 leonworld2011 阅读(532) 评论(0) 推荐(0) 编辑

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