2011年1月5日
摘要: //从SPListItem中取SPUser方法、代码 处理Sharepoint中的SPListItem时,有时需要获得这个对象的"Created By"(创建者),并且希望是SPUser类型,而不是string,这样可以进而得到该用户的权限、ID等等。 "Person or Group"(用户或组)对应的类型是SPFieldUser,怎么把SPFieldUser转成SPUser呢? 网上找... 阅读全文
posted @ 2011-01-05 11:58 Lambert_Zhao 阅读(2105) 评论(0) 推荐(1) 编辑
摘要: 使用代码批量删除列表项(Item)时应该注意,不要使用item.Update()方法,在删除以后统一使用List.Update()即可,否则可能引起报错,另外所有使用index来标志的都需要用for大到小循环。也可能会出错。使用for循环来代替。ps:记得 site.AllowUnsafeUpdates = true; web.AllowUnsafeUpdates = true; item.Update(); web.AllowUnsafeUpdates = false; site.AllowUnsafeUpdates = false; 阅读全文
posted @ 2011-01-05 11:54 Lambert_Zhao 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 方法一:直接绑定查询的数据或%# DataBinder.eval_r(Container.DataItem,"数据库字段")%%# DataBinder.eval_r(Container.DataItem, "ColumnName") % %# DataBinder.eval_r(Container.DataItem, "ColumnName", null) % %# DataBinder.eval_r(Container, "DataItem.ColumnName", null) %其他用法%# ((DataRowView)Container.DataItem)["Colu 阅读全文
posted @ 2011-01-05 11:38 Lambert_Zhao 阅读(766) 评论(0) 推荐(0) 编辑
摘要: using System; using System.ComponentModel; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using Microsoft.SharePoint; using Microso... 阅读全文
posted @ 2011-01-05 10:59 Lambert_Zhao 阅读(306) 评论(0) 推荐(1) 编辑
摘要: 在该站点下的配置文件里面修改以下节点(C:\inetpub\wwwroot\wss\VirtualDirectories\站点端口号\web.config)1.SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false"改为:SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDepend 阅读全文
posted @ 2011-01-05 10:55 Lambert_Zhao 阅读(756) 评论(0) 推荐(0) 编辑
  2010年12月30日
摘要: 主区域带滚动条:v4.master代码主区域不带滚动条:v4.master代码 阅读全文
posted @ 2010-12-30 17:19 Lambert_Zhao 阅读(3057) 评论(7) 推荐(0) 编辑
  2010年12月29日
摘要: HH为24小时制,hh为12小时制string time1=System.DateTime.Now.ToString("yyyy-MM-ddHH:mm:ss");string time2=System.DateTime.Now.ToString("yyyy-MM-ddhh:mm:ss"); 阅读全文
posted @ 2010-12-29 18:10 Lambert_Zhao 阅读(280) 评论(2) 推荐(0) 编辑
  2010年12月24日
摘要: 写SP时查询是个问题;发现一个查询语句生成器,比较方便,收录下。下载地址:http://files.cnblogs.com/zhaom/Caml%e8%af%ad%e8%a8%80%e7%94%9f%e6%88%90%e5%99%a8.rarAnd 并且 BeginsWith 以某字符串开始的 Contains 包含某字符串 Eq 等于 FieldRef 一个字段的引用 (在GroupBy 中使用) Geq 大于等于 GroupBy 分组 Gt 大于 IsNotNull 非空 IsNull 空 Leq 小于等于 Lt 小于 Neq 不等于 Now 当前时间 Or 或 OrderBy 排序 To 阅读全文
posted @ 2010-12-24 12:03 Lambert_Zhao 阅读(1298) 评论(1) 推荐(0) 编辑
  2010年12月22日
摘要: 1.SPWebApplication包含网站集,是网站集的容器。获取当前系统下所有Web应用程序的集合:SPWebApplicationCollection webs = SPWebService.ContentService.WebApplications;2.SPSite和SPWeb(1).SPSite:WebApplication下的网站集。SPSite的RootWeb代表网站集的顶级网站(首要网站)。(2).SPWeb:代表网站集下的每个站点和子站点。访问站点的内容从SPWeb开始。(3).关系:网站集SPSite是SPWeb的集合。(4).获取网站SPSite site = new 阅读全文
posted @ 2010-12-22 17:57 Lambert_Zhao 阅读(314) 评论(0) 推荐(0) 编辑
  2010年12月17日
摘要: 天气预报连接地址:http://www.thinkpage.cn/weather/widget.aspx代码天气预报连接地址:http://service.weather.com.cn/plugin/forcast.shtml?id=pn12 代码 阅读全文
posted @ 2010-12-17 15:34 Lambert_Zhao 阅读(497) 评论(0) 推荐(0) 编辑