SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to set the url title of a list view programmatically (preferrably CSOM/JSOM) so we could for example create a view whose View Name is "My View" and its web address ends with "/MyView.aspx"

enter image description here

share|improve this question
up vote 3 down vote accepted

Following code sample should help:

SP.ViewCreationInformation viewCreationInformation = new SP.ViewCreationInformation();
viewCreationInformation.Title = "My View";
viewCreationInformation.ViewTypeKind = SP.ViewType.None;
viewCreationInformation.RowLimit = 30;

//Make sure that the name of the fields should be equal to 1 any of the associated SiteColumns Internal Name. The Fields in the view will appear in the same order as declared here.
viewCreationInformation.ViewFields = new string[]{"Title","Created","Modified"};
viewCreationInformation.SetAsDefaultView = true;



If you want the URL and Title to be different, you might need to play a trick with SharePoint..

That is first create the view with title "MyView" and then get the view again and update the Title value to "My View"..

share|improve this answer
Can we change the url of an existing view? – thomius Apr 21 '14 at 11:53
I don't think that is possible.. SharePoint stores the URL and even if you update the Title, it won't change the URL.. – Arsalan Adam Khatri Apr 21 '14 at 11:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.