05 2012 档案
摘要:右键点项目选Unload project再右键点项目选编辑项目在visual studio会以XML格式显示该项目文件找第一个PropertyGroup节点在<SandboxedSolution>False</SandboxedSolution>的下一行加<TokenReplacementFileExtensions>$(TokenReplacementFileExtensions);ashx;xml;aspx;ascx;webpart;dwp;svc;asmx;</TokenReplacementFileExtensions>,这能够保证兼容原
阅读全文
摘要:SharePoint的dll部署在GAC下,而不是在网站的bin下,在开发SharePoint相关页面或web part时,需要在页首加上以下代码,$SharePoint.Project.AssemblyFullName$是visual studio编译时会自动替换的变量:<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>最好下面还能加上以下代码:<%@ Import Namespace="yournamespace" %>这样可以避免类型无法加载的错误,也可以
阅读全文
摘要:public string GetAdminEmailAddress(string room) { string userEmail = string.Empty; using (SPSite site = new SPSite(Config.URL)) { using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists[Config.MeetingRoomTitle]; SPQuery query=new SPQuery(); string camlQuery = string.Format(@" <View>
阅读全文
摘要:For changing the language of all sites in the content database to Chinese the query would be: UPDATE dbo.Webs SET Language = 2052 Changing the language of one site collection can be done with: UPDATE dbo.Webs SET Language = 2052 WHERE SiteId = [[SiteCollectionId]] And for changing the language of a
阅读全文
摘要:错误信息:System.ArgumentException: Invalid SPListItem. The SPListItem provided is not compatible with a Publishing Page“/”应用程序中的服务器错误。 --------------------------------------------------------------------------------SPListItem 无效。提供的 SPListItem 与发布页面不兼容。 说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中
阅读全文
摘要:需要激活网站feature :SharePoint Server 发布
阅读全文
摘要:Sample code:item["ParticipantsPicker"]=BuildMultiSPUserValue(new string[]{"user1","user2"},web);public static SPFieldUserValueCollection BuildMultiSPUserValue(string[] userValues,SPWeb web) { SPFieldUserValueCollection userCollection = new SPFieldUserValueCollection();
阅读全文
摘要:Objective In this article, I am going to explain, how to insert multi user or more than one user in Share point list. About SharePoint list where value would be inserted There is a list called TestingUser.There is one column in list called UserTest.This column is of type Person or Group.Allow multip
阅读全文
摘要:public static SPUser GetSPUser(SPWeb web,string userName) { SPUser user=web.EnsureUser(userName); return user; }public static int ParseLookupId(string fieldValue,SPList list,string fieldName) { int lookUpID = 0; try { foreach (SPListItem item in list.Items) { if (item[fieldName].ToString()==fieldVa.
阅读全文
摘要:When created a custom timer job in sharepoint 2010. I receive the famous "Object reference not set to an instance of an object" error on the very first line of the Execute() method.Using(SPsite site = spcontext.current.site.ID){using(spweb web = site.openweb()}When a timer job runs there i
阅读全文

浙公网安备 33010602011771号