This sample code of paging:
Thursday, January 26, 2012
SharePoint 2010 SPQuery Paging
This sample code of paging:
Saturday, January 21, 2012
Use User Task WebPart to display Site Collections Tasks
Out of the box SharePoint ships with the User Tasks Web Part which allows you to display tasks assigned to the current user in the current Site.
If you want to display all Tasks in SiteCollection you can use CQWP or DataView. But there is an easy way to do that for the same user experience. The best approach is to change the value of a hidden property of the User Tasks Web Part QuerySiteCollection. This property is hidden and cannot be modified through the UI.
First export User Tasks WebPart and add property:
<QuerySiteCollection xmlns="http://schemas.microsoft.com/WebPart/v2/Aggregation">true</QuerySiteCollection>
before the </WebPart> tag
And import again. Check the result.
This will work with SharePoint 2007/SharePoint 2010.
Friday, January 20, 2012
Editing contents of a WSP (SharePoint 2010)
In Solution file WSP in SharePoint 2010, you can see the contents of the WSP by changing the file extension to CAB. You can then open the file like a ZIP file within Windows Explorer, or via WinRAR.
But you cannot modify it using one of these items:
- Creating a new archive file within Windows Explorer – and changing to CAB or WSP extension.
- Trying to delete or drag into an archive shown in Windows Explorer.
- Creating a new archive with WinRAR – and/or dragging into a CAB file using WinRAR.
- Using MAKECAB.EXE to create an archive via command line is difficult.
I found tool (IZArc) solve this problem. Steps involved to update the WSP are as follows :
- Rename the WSP to CAB
- Extract all contents to a folder – using Windows Explorer, or WinZip, WinRAR, or whatever
- Change the items you want.
- Create a new CAB file with the updated contents, using IZARC. (IZARC support many types Archived type must be CAB and include subfolders)
- Rename the newly created CAB to WSP
- Install to SharePoint
Thursday, January 19, 2012
SharePoint 2010 Sandbox Visual WebPart
When you use sandbox Visual Web Part and TemplateControl.LoadControl method is not working in a sandbox solution?
The reason is quite simple – your code in a sandbox solution actually executes in a console application – the SPUCWorkerProcess.exe. It is a console application has created an HttpContext and a Page instance, in which your web part class is also instantiated on that page. You don’t have some crucial asp.net pieces as the HostingEnvironment and the VirtualPathProvider – without these two the LoadControl method simply won’t work. And it is not that you don’t have access to the file system, even if you had, the LoadControl method still wouldn’t work because there wouldn’t be a VirtualPathProvider to provide the file to the asp.net compiler. The bad news is that the same holds for the TemplateControl.ParseControl method too.
Microsoft create template supports Visual Web Parts in the sandbox from Visual Studio 2010 you can use when download Visual Studio 2010 Sharepoint Power Tools
SharePoint 2010 Sandbox Form Post limitation
When try to use form created in sandbox solution. I found error when post data more than 128 KB. It is one limitation of more limitations in sandbox solutions.
We need to increase size to increase this limit requestlengthdiskthreshold.
Sandbox processes use SPUCHostService.exe/SPUCHostService.exe. which has extra web.config (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\UserCode\web.config), When you updated requestlengthdiskthreshold value in this web.config problem will be solved. But this solution would not work on a hosting provider. There would be little chance they would change their UserCode settings for me.
Thursday, November 10, 2011
SharePoint Publising Page Problem MOSS Page Setting Error - Value does not fall within the expected range
Solutions:
- You cannot copy and paste the aspx page using SharePoint designer. First, export the aspx page using SharePoint designer to a physical file.
- Open the aspx page with notepad and search on the “mso:PublishingPageLayout”. You will notice your development portal URL is there.
<mso:PublishingPageLayout msdt:dt=”string”>http://xxxdevelopmenturl/_catalogs/masterpage/BlankWebPartPage.aspx, Blank Web Part Page</mso:PublishingPageLayout> - Replace your development URL (xxxdevelopmenturl) to the production URL or remove http://xxxdevelopmentur and save it.
- Open your production site with SharePoint Designer and import the modified aspx page.
If you found this error in production server open site using SharePoint Designer go to TaskPane-->Hyperlinks and edit hyperlinks of layouts like above sample:
Replace:http://xxxdevelopmenturl/_catalogs/masterpage/BlankWebPartPage.aspx
By: /_catalogs/masterpage/BlankWebPartPage.aspx
Also you can fix programmatically check url:
http://support.microsoft.com/kb/953445
Also Check this if you found your any modifications Navigation setting aren't saved.
or an error like image below:
Thursday, June 9, 2011
Failure trying to synch site for ContentDB WebApp
Periodical errors in the event log of a SharePoint 2010 server with the following error event descriptions:
Failure trying to synch site
Cause:
Old references to non existing content databases in the synchronization job list.
Fix:
List databases which are not synced for more than two days
stsadm -o sync -listolddatabases 2
Delete old database references from the config db
stsadm -o sync -deleteolddatabases 2