Customize the SharePoint listform (newform, editform, listform) with custom controls and javascript

This is the Visual studio version for SharePoint 2013 that i created of this initial code plex project

“Out of the box, Microsoft SharePoint has a very rich set of features, but sometimes you need more, or something a little different, to meet the needs of your project. This article will discuss various methods of presenting the UI for SharePoint list forms, such as the New, Edit, and Display forms used when adding an item to a list, or viewing and editing items.”

This include modifications of Create form only.

To activate the feature :

1. Activate site collection feature named “Code Project List Forms Demo”

2. Create a list based on the list definition named : “CP Project Redering Template Def”

3. The create form will contain the text from the user control “UserControl1” that you can customize, and also from : CPRenderingTemplate (which is the template of the form with save button etc)

https://sp2013customformtemplates.codeplex.com/

Advertisements

[SharePoint 2010 – Error fixing] Content By Query WebPart, display items links with wrong URL

image
You are programmatically creating a ContentQueryWebPart and when you test the solution, you try to click on an item link and you get a :
“404 NOT FOUND” page error

The error :

The Content By Query Webpart displays items url as :
http://jeff/sites/test/News/Lists/Posts/1_.000 or
http://jeff/sites/test/News/Lists/Posts/2_.000

 

Solution :

When you programmatically create the CQWP, you need to set the attribute UseCopyUtil to true.
wpCqwp.UseCopyUtil = true;
After, the item url should works and will look like :
http://jeff/sites/dzdza/_layouts/CopyUtil.aspx?Use=id&Action=dispform&ItemId=2&ListId=0b3c3cfc-5724-48e6-85ed-4943eae4f3b9&WebId=954e1a32-c41d-46f1-94b8-615ffd01156d&SiteId=edf289e7-9e97-4429-a9cf-e7d4af9636f2&Source=http%3A%2F%2Fjeff%2Fsites%2Fdzdza%2FSitePages%2FHome%2Easpx

 

Explanation :

By default, when you create a CQWP by the interface, SharePoint set the property UseCopyUtil to true.
Programmatically it’s set to false (i saw it by exporting the webpart, which gave me a .webpart file , and i compared it to a content query webpart created by interface).
Msdn explains, about that property that :
“Objects that are not streamed, such as announcements or calendar events, do not have an associated URL. When you set this property to true, objects that are not streamed have an associated URL that points to the View property of the item. “ Msdn
 
Voila !

Blog at WordPress.com.

Up ↑