1

I have created a sp 2013 survey list. I testen this url to fill in the questions:

http://myCompany.com/Lists/MySurvey/NewForm.aspx?isdlg=0&Source=http://www.google.com

After I submit the form I only see a blanco page. The survey did not redirected to the source query string. Do I miss something?

2
  • 3
    is ?Source a typo? in that case it should be &Source= Commented May 28, 2015 at 13:37
  • no, also with &source it is not working. I updated the url :)
    – Ola
    Commented May 28, 2015 at 13:53

2 Answers 2

3
+25

I think that this is a question about security as this could be a potent risk redirecting a user to anywhere ( or anything ) on the web.

This was considered a potential security vulnerability by Microsoft a couple of years ago for SharePoint 2007 and 2010 so in 2013, a cross site redirect is being prevented by default.

Insecure Redirect in Microsoft Sharepoint

Microsoft Security Bulletin MS11-074

The Source parameter is correct, however the source parameter works only for URL'S in the same web application, etc sub sites, pages, other site collections.

If you wanna do a redirect to another web application or a external URL you have to go with custom code, like JavaScript.

Or you could simple create a page based on the template "Redirect" (Sp2013), enter any external URL/web application of yours and simple redirect your form to this page and then from this page, redirect the users anywhere.

However the default time for a redirect is 5 second for the OOTB redirect template.

A example applicable for you could be

http://myCompany.com/Lists/MySurvey/NewForm.aspx?isdlg=0&Source=http://myCompany.com/pages/redirect.aspx

If you are on SharePoint 2007 or 2010, you could create a simple page and use this code in a txt file that you connect to a content editor web part on the page. You can define how fast the redirect should trigger by setting "content" to any number.

<meta http-equiv="refresh" content="3;url=http://anyUrl">

This works as well in the script editor web part for 2013, however i think it's best to have the code connect through a txt file, otherwise you will have a hard time to reach the page if you like to do some changes in the future.

5
  • The source querystring don't work if you use the querystring isdlg=0. I would like to redirect after I click on the submit button.
    – Ola
    Commented Jun 8, 2015 at 8:05
  • I used "isdlg=0" in the example as you were using it. I cannot update my anser anymore so simply remove it. It is not necessary as you say. As long as you redirect to a page/site in the same web application, it will work. The example above works. Just remove "isdlg=0&" Commented Jun 8, 2015 at 8:07
  • Or if you wanna redirect to another external URL or web application, use my other suggestion with an additional redirect page. Commented Jun 8, 2015 at 8:11
  • ://myCompany.com/Lists/MySurvey/NewForm.aspx?Source=://myCompany.com/Lists/MySurvey/summary.aspx Commented Jun 8, 2015 at 8:17
  • Just add correct protocol to the Url above. Just tried it a survey list and it worked as expected. Commented Jun 8, 2015 at 8:18
2

If a survey includes page breaks (i.e. uses branching logic or the "page separator" question type), the "Source" URL query string parameter is discarded as the user progresses through the survey (e.g. clicks the "Next" button).

Because a list item is created and updated as the user completes a survey, the "Next" button triggers a post-back using the WebForm_DoPostBackWithOptions() function. Options for the post-back are defined using the WebForm_PostBackOptions() function. To my knowledge, neither of these functions offer any way to ensure preservation of URL query string parameters.

This default behavior is unrelated to cross-site security concerns and simply a matter of the form not handling unexpected URL query string parameters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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