C#技术总结

1、window.open()或者window.showDialog()弹出的窗体中点按扭执行事件时会弹出一个新的页面.

解决办法:<base target="_self"/>

2、frameset框架中在top或left中有链接要使浏览器窗口转向.

解决办法:<a target="_parent" ></a>

3、在frameset框架中使用Javascript要使浏览器转向.

解决办法:window.open(url,"_parent");

4、关于Request.HttpMethod

1>在地址栏输入Url访问时,Request.HttpMethod为Get

2>当页面有某个控件触发事件时, Request.HttpMethod与form的Method属性值相同

3>在某个页面F5/刷新时,Request.HttpMethod与form的Method属性值相同

(注意:form默认的method为post)

5、清除所有的缓存

IDictionaryEnumerator CacheEnum = Cache.GetEnumerator();

while (CacheEnum.MoveNext())

{

Cache.Remove(CacheEnum.Key.ToString());

}

Response.Write("缓存清空成功");

6、1)Linq中的几个方法

Except 返回包含两个不同之处的linq结果集

Intersect 返回两个容器中共同的数据项

Union 返回所有成员,相同的成员出现多次,将只返回一个

Concat 返回所有数据项

2)星期几转换成中文:

string week = DateTime.Today.ToString("dddd", new System.Globalization.CultureInfo("zh-CN"))

7、

1)问题描述:编译器错误消息: CS0016: 未能写入输出文件“c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\16faacf5\fb33357\App_Web_index.aspx.cdcab7d2.mmqzdk2r.dll”--“拒绝访问。 ”

解决方法:c:/windows/temp 文件夹添加一个everyone

2)问题描述:C#以一个字符串为分割切割别一个字符串

string sql_fields = sqlCmd.Trim().ToLower().Split(new string[] { " from " }, System.StringSplitOptions.RemoveEmptyEntries)[0];

string[] fieldArr = sql_fields.Split(',');

string orderField = fieldArr[0];//排序字段

string queryField = fieldArr[1];//查询过滤字段

8、以空字符开头或空字符结尾:

(^[ \t\n\r]+)|([ \t\n\r]+$)

9、查找UEditor中的内容

var e = UE.getEditor('editor');

var n = UE.getEditor('editor').document.getElementById("t_t");

10、

/// <summary>

/// 判断DataReader中是否存在指定列

/// </summary>

/// <param name="dr"></param>

/// <param name="columnName"></param>

/// <returns></returns>

public bool ReaderExists(SqlDataReader dr, string columnName)

{

int count = dr.FieldCount;

for (int i = 0; i < count; i++)

{

if (dr.GetName(i).Equals(columnName))

{

return true;

}

}

return false;

}

11、将form表单元素转为实体对象或集合(MVC)

http://www.cnblogs.com/sunkaixuan/archive/2015/05/27/4532558.html

12、Javascript的匿名函数与自执行

http://www.jcodecraeer.com/a/jquery_js_ajaxjishu/2012/0628/290.html

http://stackoverflow.com/questions/10896749/what-does-function-function-window-jquery-do?rq=1

13、bootstrap

http://getbootstrap.com/2.3.2/components.html#buttonGroups

14、

http://www.cnblogs.com/kevin-kingdom/archive/2012/11/30/2795677.html

http://www.cnblogs.com/John-Connor/tag/ASP.NET%20MVC/

T4模板

http://www.cnblogs.com/heyuquan/archive/2012/08/07/t4-architecture.html

javascript:

http://www.ruanyifeng.com/blog/2015/05/co.html

Mvc.net 与 WebForms共生

http://www.cnblogs.com/younggun/archive/2011/09/06/2168226.html

RDLC报表在MVC中应用

http://www.codeproject.com/Articles/609580/Prototype-MVC4-Razor-ReportViewer-RDLC

http://www.cnblogs.com/wuhuacong/p/4109833.html

http://www.c-sharpcorner.com/UploadFile/0b8108/rdlc-report-in-Asp-Net-mvc-razor-aspx/

http://stackoverflow.com/questions/8925077/mvc3-razor-vs2010-reportviewer-example

http://blog.csdn.net/chuangxin/article/details/4060669(手册)

http://qingyanxiyu.iteye.com/blog/1094538 (RDLC中的表达式)

Linq:

Select(p => new {p.OrderID,p.CustomerID,p.ShipName,p.ShippedDate}) :select 多个字段

http://www.cnblogs.com/jack86514/archive/2010/01/22/1653762.html

C#中的split

string[] arrs = Regex.Split("ddd,ddd.ddd,ddd.ddd;sdfsdf", ",|\\.", RegexOptions.IgnoreCase);