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

Simple question but I just couldn't find a simple answer. I want to add a little piece of css / javascript code to the AllItems.aspx view of a custom list upon deployment. I know how to get it there via Designer, I know how to create a listview and set the column and stuff in the xml schema file, but I don't know where to put my additions.

share|improve this question
up vote 1 down vote accepted

I found the answer in the way you can deploy a custom NewForm.aspx page. Deploying modifications to the AllItems page takes the same approach.

  1. Copy the file found in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\Pages\viewpage.aspx into your solution. This is the file that's being used by SharePoint as AllItems.aspx as long as you don't make any changes (otherwhise it's ghosted into your content database).
  2. Make the changes you want to
  3. Change the schema.xml file and swop



Path="CustomAllItems.aspx" (or whatever you named the file)

  1. Make sure your new file is listed as an ElementFile in the element.xml file, so it actually get's deployed to the feature directory.

That's it!

share|improve this answer
Made a blog post about this with further instructions: – Jasper Oct 21 '11 at 9:10

I faced a similar situation not long ago.

What I did was that I took a copy of the list's AllItems.aspx pasted it into my solution, made the modifications that I needed and then created a feature in which I pointed at the specific list and programmatic switched out the existing AllItems.aspx with my "custom" version of it.

list.DefaultDisplayFormUrl = URL to the new display form here;

share|improve this answer

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.