Loading

随笔分类 -  .NET/NET CORE

.NET/NET CORE
摘要:未找到与命令“dotnet ef”匹配的可执行文件 Specific to VS2017 15.3 or greater and ASP.NET CORE 2.0 or later... Install nuget for db provider via command line or nuget 阅读全文
posted @ 2018-04-17 18:20 Dhoopu 阅读(2391) 评论(0) 推荐(0) 编辑
摘要:I have set the .ASPXAUTH cookie to be https only but I am not sure how to effectively do the same with the ASP.NET_SessionId. The entire site uses HTTPS so there is no need for the cookie to work with both http and https 阅读全文
posted @ 2018-03-06 17:52 Dhoopu 阅读(1117) 评论(0) 推荐(1) 编辑
摘要:C# 移除Response Header,403调整返回为404Make IIS return a 404 status code instead of 403 阅读全文
posted @ 2018-02-07 15:52 Dhoopu 阅读(573) 评论(0) 推荐(0) 编辑
摘要:I understand that IValidatableObject is used to validate an object in a way that let's one compare properties against each other. I'd still like to have attributes to validate individual properties, but I want to ignore failures on some properties in certain cases. 阅读全文
posted @ 2018-01-17 20:10 Dhoopu 阅读(398) 评论(0) 推荐(0) 编辑
摘要:I have navigate lots of similar pages on the web, but most of them use a new project instead of an existing one, or not have the necessary features. So, I have an existing MVC5 project and want to integrate ASP.NET MVC5 Identity with log in, email confirmation and password reset features. In addition to this, I also need to create all the necessary tables on the database i.e. User, Roles, groups, etc. (I use EF Code First in my project). Is there any article or sample that corresponds these need 阅读全文
posted @ 2017-09-18 20:17 Dhoopu 阅读(4814) 评论(0) 推荐(0) 编辑
摘要:Implementing HTTPS Everywhere in ASP.Net MVC application. HTTPS everywhere is a common theme of the modern infosys topics. Despite of that when I goog 阅读全文
posted @ 2017-09-07 14:45 Dhoopu 阅读(411) 评论(0) 推荐(0) 编辑
摘要:添加Startup.Auth.cs 添加Startup.cs 注意要添加[assembly: OwinStartup(typeof(Startup))] 在代码中就可以自己设置登录状态了 阅读全文
posted @ 2017-08-18 19:34 Dhoopu 阅读(519) 评论(0) 推荐(0) 编辑
摘要:The error message while trying tocreate a ADO.net Entity Data Model ( Entity Framework 6 ) for MySql Database in Microsoft Visual Studio 2013"Your pro... 阅读全文
posted @ 2014-12-09 17:36 Dhoopu 阅读(14252) 评论(0) 推荐(2) 编辑
摘要:public static class HtmlRequestHelper{ public static string Id(this HtmlHelper htmlHelper) { var routeValues = HttpContext.Current.Reques... 阅读全文
posted @ 2014-11-27 17:54 Dhoopu 阅读(650) 评论(0) 推荐(0) 编辑
摘要:void Application_BeginRequest(object sender, EventArgs e){if (HttpContext.Current.Request.Url.ToString().ToLower().Contains("http://domain.com")){// n... 阅读全文
posted @ 2014-11-25 17:06 Dhoopu 阅读(275) 评论(0) 推荐(0) 编辑
摘要:The same solution can be applied for LINQ to SQL. The snippet the article shows for using theMetadataTypewill use perfectly well with LINQ to SQL gene... 阅读全文
posted @ 2014-11-14 14:33 Dhoopu 阅读(268) 评论(0) 推荐(0) 编辑
摘要:A few days ago, while working on anASP.NET 4.0 Web project, I got an issue. The issue was, when user entersnon-encoded HTML contentinto a comment text box s/he got something like the following error message:"A potentially dangerous Request.Form value was detected from the client".This was 阅读全文
posted @ 2013-12-05 16:19 Dhoopu 阅读(307) 评论(0) 推荐(0) 编辑
摘要:I got this error today when working on a migrated ASP .NET MVC 4 project. It was especially confusing for me because I already had a reference toSystem.Data.Entityin my web project.The type 'System.Data.Objects.DataClasses.EntityObject' is defined in an assembly that is not referenced. You m 阅读全文
posted @ 2013-05-27 16:22 Dhoopu 阅读(5392) 评论(0) 推荐(0) 编辑
摘要:string controllerName = (string)htmlHelper.ViewContext.RouteData.GetRequiredString("controller");string areaName = (string)htmlHelper.ViewContext.RouteData.DataTokens["area"];在 controller 中可以使用ControllerContext 取得:12ControllerContext.RouteData.Values["controller"]Contro 阅读全文
posted @ 2013-02-02 19:49 Dhoopu 阅读(1637) 评论(0) 推荐(0) 编辑
摘要:今天刚学MVC的Razor,一起用了Entity Framework ,结果出现如下错误:CS0012: The type 'System.Data.Objects.DataClasses.EntityObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. 阅读全文
posted @ 2012-09-04 00:17 Dhoopu 阅读(1304) 评论(0) 推荐(0) 编辑
摘要:Html.BeginForm("ActionName", "ControllerName", FormMethod.Get, new { name = "FormName", id = "FormID" }) 阅读全文
posted @ 2012-06-15 18:43 Dhoopu 阅读(375) 评论(0) 推荐(0) 编辑
摘要:Jquery Ajax方法传值到action<script type="text/javascript"> $(document).ready(function(){ $("#btn").click(function(){ $.ajax({ type: 'POST', url: "/Home/MyAjax", data: { val1: $("#txt1").val(), ... 阅读全文
posted @ 2012-06-15 18:38 Dhoopu 阅读(11896) 评论(1) 推荐(3) 编辑
摘要:<%: ViewData["Message"] %>冒号的绑定可以自动转换HTML编码的代码(所以我一直无法在前台显示我在后台拼接的HTML代码,而使用 Response.Write(pager.MvcPager()) 又是正常显示的)<%= Model.ModelPagerHtmls %>等号的绑定没有这种机制 阅读全文
posted @ 2012-06-13 15:56 Dhoopu 阅读(400) 评论(0) 推荐(0) 编辑
摘要:Html.TextBoxis not strongly typed and it doesn't require a strongly typed view meaning that you can hardcode whatever name you want as first argument and provide it a value:<%= Html.TextBox("foo", "some value") %>You can set some value in theViewDatadictionary inside th 阅读全文
posted @ 2012-05-30 22:15 Dhoopu 阅读(770) 评论(0) 推荐(0) 编辑
摘要:FormExtensions类 FormExtensions类是一个静态类,定义了3种类型的扩展方法:BeginForm、BeginRouteForm、EndForm;在实际开发中,也可以使用using语句,而不需要写EndForm扩展方法。 InputExtensions类 InputExtensions类定义了5种类型的扩展方法:CheckBox,Hidden,Password,RadioBu... 阅读全文
posted @ 2009-10-14 16:01 Dhoopu 阅读(660) 评论(0) 推荐(0) 编辑

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