This project has moved and is read-only. For the latest updates, please go here.

How to Copy an .aspx page using SPServices

Dec 16, 2011 at 9:57 PM

Hi All,

Is there way to copy an existing .aspx page using SPService (or SP Webservices for that matter)?

Looked at the documentation and could not determine if it is possible... I'm trying to make a backup of a specific file.

Thanks in advance for your help.



Dec 17, 2011 at 12:45 PM

It really depends on where the page is. Do you not have SharePoint Designer? Is it in a Document Library?

Dec 17, 2011 at 2:36 PM


Re: Sharepoint Designer

I do have sharepoint designer, but using it is not an option... I need to be able to do it via webservices...

Re: Location of aspx page

No, the page is not in a document library (unfortunately)... It is currently located next to a List's default edit page (mine is called .../Lists/Documents/library.edit.aspx).

Appreciate you commenting on this thread.




I little background on the need: As part of my SP app. and as I make available a new version of it (which I release as a zip file), I provide a "transition" panel accessible to "Full Control" users, that makes updates necessary to the site, needed for the new version. The need to make a backup of an aspx page is one that has not come up in the past... I will need to make a backup of it and then (in a later version of the app.) I will overlay it with a new one.



Dec 17, 2011 at 2:41 PM

It sounds like you're trying to mirror the feature-based deployment model with your ZIP file. If you can really pull that off, it would be awesome.

As for copying files (or uploading new ones), I've never cone up with a way to donut. The Copy Web Service is too specialized, as it only copies documents and won't give up the link between them.

Dec 17, 2011 at 2:59 PM
Marc, remember some time ago, I used the document itself as its own parent. It might take me some time, but I will see if I can find that code. It might be useful.

Sent from my iPhone

On Dec 17, 2011, at 9:42 AM, "sympmarc"<> wrote:

From: sympmarc


It sounds like you're trying to mirror the feature-based deployment model with your ZIP file. If you can really pull that off, it would be awesome.

As for copying files (or uploading new ones), I've never cone up with a way to donut. The Copy Web Service is too specialized, as it only copies documents and won't give up the link between them.

Dec 17, 2011 at 3:19 PM

Thanks Marc.. I'll keep searching... and Yes, I am using the zip file deployment approach and thus far have been very successful.

A little about this particular app. (note: I'm not in IT and only have access to SP Designer):

This particular app is currently working in production and deployed by about 10 groups through out the company... The system is avialble to any group as a Site Template. I developed it using SP Designer, and javascript, and had our IT team create a Site Template from it when it went v1.0. From that point forward, updates are made avialable via a zip file, and groups that have created sites based on this app's template, update it by extracting the zip file onto the site (using windows explorer).

The system is a Document Repository application that assigns document numbers based on a corporate standard and manages the collection and presentation of those document (multiple issues of the same document, revision, etc). It also helps with managing the requirements imposed upon groups by our Software Quality Process. It is not a "working" location for users to collaborate, but rather where an end user uploads the documents once they have gone through the necessary reviews and baseline process.

The system is composed of about 10 Lists and 2 Document libraries... There are a few workflows that were developed to handle automation in the background. The front end is completely revamped in html, jquery and obviously SPServices. The user is presented with a very controlled UI that masks the collection of the necessary meta data. Administrator of these sites have full control an access to some additional admin only panels that I created to help manage "reference data" that keeps the site together.

Although not the appropriate forum post, let me again thank you for creating such a great jQuery library... This particular system I build might not have happen if your library did not exists; or at least it would have taken double the time to create.  As I have mentioned in some of my prior posts, I have developed a few "utilities" that use SPServices, which I will post here at some point for others to take advantage of and perhaps for you to consider including in SPServices... Some of those include:

  • SPControlledUpload : A jquery plugin that, without leaving the current page that the user is on, present an upload box in a modal jQuery UI dialog. Allows for a user to upload a file to a pre-defined location (controlled via the input parameter) without having to leave the page they are currently viewing.
    Employs jQuery, iframe content, SPServices and manipulates the Sharepoint upload interface inside the iFrame to only display the file upload input. Include abilitty to define functions as an imput parameter that is called at different events.

  • SPEditItem :  A jquery plugin that converts a pre-defined set of HTML elements into an "EDIT" form.  In my app., I developed several update "panels" that collect only the minimum amount of information from ther user... I use this method to "convert" that set of html to an edit form against a particular list; all dynamically defined via input parameters.

  • SPPeoplePicker : A jquery plugin that converts a simple html input field into a sharepoint people picker using jQuery UI's Autocomplete.


I have been delaying posting these, because I need to clean them up and insure I remove any proprietary information... One of these days I'll post it.






Dec 17, 2011 at 5:22 PM

Sounds interesting! One thing that I like to do is add actions like that to the ECB of a list view. It lowers the amount of clicks the user needs to accomplish a task and can be done on any item without leaving the page. Good stuff indeed!

Dec 17, 2011 at 5:35 PM

Your custom list form shouldn't have to live on the list context. What if you deployed all of your aspx pages to a Document Library with versioning turned on? Then you'd get an automatic "backup" of the files.

Thanks for sharing the details about what you've been up to. It sounds like it would make a great article for EUSP. Are you game?

Dec 17, 2011 at 6:24 PM


Yes, I probably should have included the aspx pages in a library to begin with... I am holding on to an alternate approach that I rather now implement... In my app, because I control the entire UI for the user, I actually keep a global js object that stores the links to various page... example, I have a property of tt.pages.docEditPage = "/Lists/Documents/libraryEditDoc.aspx"... I could just create a new Edit page (say, libraryEditDoc2.aspx) and edit my js variable and I'm done... but I was just exploring if backing up existing file, then overlaying it could be done (and would be preferable for me).

This particular project was my first exposure to SP, thus I did not know much (and still claim I don't know much now)... My approach would have been different... much diferent... take for example, up until last week, I did not think I could make aspx pages "generic"... as you probably know, in SP2007, the use of SP Designer uses List's UID's instead of the list name (for default values). I learned, through a post I read somewhere else, that once done with customization via SP Designer, I could actually go in "manually" and change UID's to the List Title...



Sure, it sounds like it is something that others could benefit from while leveraging the SP Platform. I'll try to find some time write something up. I have not visited the site in some time, so I'll make it a priority one of these days...