随笔分类 - asp.net
摘要:更改form的默认设置,让系统不再根据设备来判断是否支持cookie在站点的配置文件中有关于Form认证的配置,在配置/中要加上cookieless="UseCookies",默认的配置是UseDeviceProfile,即工具设备来决定Cookies的支持。详情请直接参考:http://www.c...
阅读全文
摘要:本文介绍一些最适合.NET开发人员简化Web开发的最佳工具,这些工具都是开源的,有的开发工具你既可以从网上下载可执行文件,也可以下载源代码。一些工具拥有可扩展的框架,是一个持续集成工具。http://www.csdn.net/article/2014-09-04/2821565-net-tool
阅读全文
摘要:Uri uri = new Uri("http://www.yoercn.com/aboutus/idea.html"); string Host = uri.Host; //www.yoercn.com string AbsolutePath = uri.AbsolutePath; //aboutus/idea.html string AbsoluteUri = uri.AbsoluteUri; //http://www.yoercn.com/aboutus/idea.html ...
阅读全文
摘要:使用code first 做数据迁移新增非空字段,提示如下错误:AlterColumn("dbo.StoreProduct", "StoreProductAttribute", c => c.String(nullable: false, maxLength: 20, defaultValue: "固定资产"));不能将值 NULL 插入列 'ProductAttribute',表 'dbo.StoreProduct';列不允许有空值。UPDATE 失败。语句已终止。由于数据表StoreProdu
阅读全文
摘要:在服务器上新建网站或虚拟目录的时候,如果需要求该.net的版本,则会提示需要重启IIS(很奇怪本地却可以直接修改)。如果重启的话,网站就会出现短暂的无法访问。使用以下方法可以不重启IIS修改dotnet framework版本1.在cmd里切换到.net目录如:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30128>2.运行命令:aspnet_regiis.exe -norestart -s W3SVC/编号 编号:在IIS中的网站或虚拟目录上点右键→所有任务→将配置保存到一个文件,在其中找到这样一段路径:“W3SVC/997936427” 注:虚拟目
阅读全文
摘要:public ActionResult Edit(int id) { using (DataContext db = new DataContext(ConfigurationManager.ConnectionStrings["sqlConnection"].ConnectionString)) { IQueryable<ClassInformation> result = from c in db.GetTable<TClass>() ...
阅读全文
摘要:List<int> 转 string :list<int>: 1,2,3,4,5,6,7 转换成字符串:“1,2,3,4,5,6,7”List<int> list= new List<int>() { 1, 2, 3, 4, 5, 6, 7 };string depaid = string.Join(",", list);string 转List<int>:string s = "1, 2, 3";List<string> list = new List<string>(
阅读全文
摘要:var query = (from s in ctx.Students.Include("ClassRooms") join sd in ctx.StudentDescriptions on s.StudentID equals sd.StudentID into g from stuDesc in g.DefaultIfEmpty() select new { ...
阅读全文
摘要:由于备案的问题,现在使用Nginx做代理对网站进行访问。Nginx安装到国外的服务器上(www.a.com),然后代理到国内的服务器上(aa.d.com)。发现 使用HttpContext.Current.Request.Url.Host.ToString()获取域名地址是aa.d.com。导致很多功能都链接到aa.d.com上。临时解决办法:HttpContext.Current.Request.Url.Host 直接返回Nginx上的域名地址(www.a.com)。
阅读全文

浙公网安备 33010602011771号