SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

I have a custom list form in SharePoint Online 2013 which after validating using the PreSave() function displays a modal dialog giving the user a choice of two outcomes. This works fine and the user is returned to the lists's AllItems.aspx page.

What I would like to do is return the user to the site's Home Page and have tried to achieve this by using the following code:

WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(saveButtonName, "", true, "", "https://[mydomain]", false, true));

The url is valid, and redirects correctly, but I am returned with a SharePoint error:

Sorry, something went wrong

This Page has been modified since you opened it. You must open the page again.

Is there a way to overcome this issue or should I be using another way to skin this particular cat?

share|improve this question
up vote 1 down vote accepted

How about relying on the Source querystring instead?

Here is a crude example of what I'm getting at:

(function(w) {
  w.PreSaveAction = function() {
    return w.confirm('Have you been working on it?');

  var source = '/sites/dev/SitePages/Home%20Page.aspx';
  var loc = w.location;
  var s =;
  if (s.indexOf(source) >= 0) return;

  loc.href = loc.href.replace(/\?.*/, '') + '?' + s.replace(/\?/, '').split('&').filter(function(q) { 
    return !q.match(/^source/i); 
  }).join('&') + '&Source=' + source;
share|improve this answer
Thanks for the suggestions. I'm currently focussed elsewhere but will give your suggestion a try in a few days – Fairfield Feb 18 '14 at 23:35

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.