I came across a situation when client wants to redirect different url after item is saved.
By using Jquery I am able to redirect to a different page after user had save all information from page.
Use below Jquery to change redirect URL of save button
//Select Save btnSave
var btnSave = $(“input[id$=SaveItem]”);
//Remove Default Redirect Attribute of Save
var elementName = $(this).attr(“name”);
var newPostbackUrl = “http://dell-pc:9999/_layouts/settings.aspx”;
if (!PreSaveItem()) return false;
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(elementName, “”, true, “”, newPostbackUrl, false, true));
During development of SharePoint Project code I found a field contains multiple name and i was confused for multiple names.
After doing some research I found detailed information about them
Display Name : A string that contains the display name. (Display Name also known as Title)
Internal Name: Gets the internal name that is used for the field.
Static Name: Gets or sets the internal name of the field.
Display Name is the name shown to the user. It can contain spaces in special characters. When display name is created, an Internal Name is derived from it by replacing spaces and special characters with _0xXXXX_ where XXXX is a Unicode hexadecimal representation of the character being replaced. For example: My Column Name would be converted to My_0x0020_Column_0x0020_Name. Once the Internal Name is set it cannot be changed even if the Display Name from which it is derived is changed.
Display Name: A string that contains the display name. Display name is used to derive Internal and Static Names, however once those are set, changing Display Name will not affect Internal and Static Names.
Internal Name: Gets the internal name that is used for the field. It is a unique non-changeable string that identifies a column in the list. If multiple columns in the list have the same name, SharePoint will add 0,1,2,etc at the end of each new column added to make them unique.
Static Name: Gets or sets the internal name of the field. This is the internal name of the fields without any digits added to it. It is not guaranteed to be unique within a list.
SharePoint Feature is part of Packaging and Deployment in SharePoint 2010. Depending on feature scope we can activate and deactivate functionality of solution on Site collection or web level.
Below link gives more detailed information about feature and its scope.
We are using SPWeb.AvailableContentTypes and SPWeb.ContentTypes to get content types from SharePoint.
I was facing an issue regarding content types that some content types are not available from code because I was using AvailableContentTypes from sub site and after some research I found difference between SPWeb.AvailableContentTypes and SPWeb.ContentTypes
The ContentTypes property returns only the content types that exist on the current Web site, not all content types in the current scope.
Use the AvailableContentTypes property to return all content types in the current scope, including those of any parent Web sites.
static void GetContentTypes()
using (SPSite oSite = new SPSite(@”http://dell-pc:9999/”))
using (SPWeb oWeb = oSite.OpenWeb())
//SPContentTypeCollection ctypecoll = oWeb.ContentTypes; // USING CONTENT TYPES
SPContentTypeCollection ctypecoll = oWeb.AvailableContentTypes; // USING AVAILABLE CONTENT TYPES
foreach (SPContentType type in ctypecoll)
Console.WriteLine(“ID: ” + type.Id + ” ; Name: ” + type.Name);
Every SharePoint Development Project need to create Site Columns , Content Type , List from code which is used to deploy it on any server.
Please check below link to create Site Columns , Content Types and List programmatically
During development of a new project I came across a situation where I need to create blank solution of Project.
Once a blank solution is created I can add multiple solution in it
To Create Blank Solution from Visual Studio follow steps:
- On the File menu, select New and then click Project.
- In the Project types pane, select Other Project Types and then select Visual Studio Solutions.
- In the Templates pane, select Blank Solution.
- Enter a name for the project.
- To change the location of the solution directory, choose Browse and specify a new location.
- Select Add to Source Control if you want to add the solution to a source control database or repository.
- Click OK.
For Project and more details about this please check Microsoft link