随笔分类 -  ASP.NET

摘要:如何为Client配置Odata Client去访问由Odata代理的Server API vs 添加插件 open vs(2017) tools Extension and Updates Online vs marketplace input: OData Client Code Generat 阅读全文
posted @ 2019-05-10 18:13 YanyuWu 阅读(456) 评论(0) 推荐(0)
摘要:本文转自: https://www.cnblogs.com/dudu/p/10807471.html 昨天回答了博问中的一个问题 —— “ "HTTP 错误 500.19 Internal Server Error dotnetcore" ”,今天在这篇随笔中时候事后诸葛亮地小结一下。 服务器是 W 阅读全文
posted @ 2019-05-04 23:24 YanyuWu 阅读(525) 评论(0) 推荐(0)
摘要:问题起因 在做项目的时候,我使用HttpContext.Current.User.Identity.Name来获取Web应用程序正在使用时的用户名。 在开发过程中,我使用了我的本地iis,启用了集成的Windows身份验证,启用了匿名访问和禁用,我能够获得用户名。 现在,当我发布Web应用程序时,它 阅读全文
posted @ 2019-03-01 14:32 YanyuWu 阅读(1512) 评论(0) 推荐(0)
摘要:Config Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by 阅读全文
posted @ 2019-01-11 14:31 YanyuWu 阅读(1464) 评论(0) 推荐(0)
摘要:一般是asp.net的项目在启动的时候会报这个错误. 页面显示成: 我推测的原因是由于project的build的输出属性改了, 非bin目录下, 导致这个问题. 解决这个问题的方案有两个: 1. 改回去, 2. 将编译输出的文件手动拷贝到bin下 有其他的解决方案的欢迎在下方留言讨论. 阅读全文
posted @ 2018-12-12 18:05 YanyuWu 阅读(1344) 评论(0) 推荐(0)
摘要:做web项目难免要将项目部署, 要么部署在azure上,要么部署在本地, 使用IIS去host. 部署步骤很简单, 1. vs打开你的web项目, 项目名上面右键选择publish 2. 在弹出的publish界面上创建一个profile, 配置的路径选择file system 3. 后面没什么要改 阅读全文
posted @ 2018-11-16 12:28 YanyuWu 阅读(279) 评论(0) 推荐(0)
摘要:这个case主要是我在做项目的时候遇到一个需要根据input控件输入的内容,动态填充dropdown list中的内容, 实现二者联动的需求。在搜索了一些资源后,这篇博客解决了我的问题,所以记录并转载一下。 转载自: https://www.jb51.net/article/88986.htm 数据 阅读全文
posted @ 2018-11-08 10:11 YanyuWu 阅读(947) 评论(0) 推荐(0)
摘要:Provides a way to specify that ASP.NET routing should not handle requests for a URL pattern. ex: The StopRoutingHandler class enables you to specify t 阅读全文
posted @ 2018-11-06 15:49 YanyuWu 阅读(192) 评论(0) 推荐(0)
摘要:Provides a collection of routes for ASP.NET routing. The RouteCollection class provides methods that enable you to manage a collection of objects that 阅读全文
posted @ 2018-11-06 14:42 YanyuWu 阅读(274) 评论(0) 推荐(0)
摘要:Provides properties and methods for defining a route and for obtaining information about the route. ex: The Route class enables you to specify how rou 阅读全文
posted @ 2018-11-06 14:35 YanyuWu 阅读(294) 评论(0) 推荐(0)
摘要:用于提供一些属性和方法来定义如何将URL匹配到一个物理文件上面。 Parameters virtualPathString The virtual path of the physical file of this Route object. The file must be located in 阅读全文
posted @ 2018-11-06 14:25 YanyuWu 阅读(162) 评论(0) 推荐(0)
摘要:你可以自己定义你的ASP.NET程序接收的get post put 或者delete请求。 使用这个约束的方式为: 参考资料: https://docs.microsoft.com/en-us/dotnet/api/system.web.routing.httpmethodconstraint?vi 阅读全文
posted @ 2018-11-06 14:19 YanyuWu 阅读(159) 评论(0) 推荐(0)
摘要:1. 有什么用? 通常用来标识http请求中的内容的类型用来告诉server端如何解析client端发送的message, 或者标识client希望从server端得到的资源是什么样的类型。又被称为MIME type。 2. 怎么用? media-type一般被放在header里面。比如一个http 阅读全文
posted @ 2018-09-17 16:56 YanyuWu 阅读(635) 评论(0) 推荐(0)
摘要:在web api的设计上, 需要设计这个每个action对应的资源的请求方法是什么。 Get方法是对服务器资源的请求获取, 一般get方法的参数都放在URL当中的。 所以通常情况下这种请求方式都是不安全的。 Post方法是对服务器资源的增加。Post请求不属于idempotent。Post请求的参数 阅读全文
posted @ 2018-09-17 16:16 YanyuWu 阅读(651) 评论(0) 推荐(0)
摘要:MSDN: 这个属性是在配置web api的httpconfiguration的时候配置的。 那么他到底有什么作用呢? 根据 流程图 中所示, server 中的controller会使用相应的orm进行资源访问, 所以orm的实例如果在controll类中实例化, 则会导致代码多种不优雅: 导致C 阅读全文
posted @ 2018-09-10 18:14 YanyuWu 阅读(163) 评论(0) 推荐(0)
摘要:自己根据理解做的图, 如有不对欢迎指正 阅读全文
posted @ 2018-09-10 15:40 YanyuWu 阅读(113) 评论(0) 推荐(0)
摘要:<script type="text/javascript"> $(document).ready(function () { //查询数据 $.ajax({ url: "http://localhost:58594/api/employeemsg/Get", type: "get", succes 阅读全文
posted @ 2018-09-10 11:44 YanyuWu 阅读(195) 评论(0) 推荐(0)
摘要:异常处理 为了便于开发人员定位http错误,也为了向客户端显示更加友好的http错误信息,你可以手动定义http异常信息,这样可以把友好的异常信息响应给客户端,也可以定义一个http异常过滤器,异常过滤器应从ExceptionFilterAttribute派生。 手动定义http异常 手动定义htt 阅读全文
posted @ 2018-09-10 11:43 YanyuWu 阅读(494) 评论(0) 推荐(0)
摘要:右击API项目属性 - 生成 - 勾选生成xml文档,为xml文档命名,这会为项目生成一个xml格式的说明性文档 打开项目目录,Areas - HelpPage - App_Start - HelpPageConfig.cs,在Register方法中注册xml说明文档 public static v 阅读全文
posted @ 2018-09-10 11:41 YanyuWu 阅读(633) 评论(0) 推荐(0)
摘要:在WebApiConfig文件中,代码如下: 阅读全文
posted @ 2018-09-10 11:37 YanyuWu 阅读(269) 评论(0) 推荐(0)