Redirection across site collections
I am working in a SharePoint 2013 environment using Host Named Site collections and I have created a list and embedded a form on the site collection called http://testtwo/ I want users to access this form from a different site collection called http://testone/ , submit the form and then be redirected back to the original site collection http://testone .
I have managed to redirect users to a Thank you page with in the site collection http://testtwo but cannot find a way to redirect them back to the original site collection http://testone.
I have used the following code on the submission buton
fd.cancel().click(function(){ STSNavigate('http://testone/SitePages/Home.aspx');return false; });
fd.onsubmit(function (){
$("#aspnetForm").attr('action',location.pathname+'?Source=http://testone/SitePages/Home.aspx');
return true;
});
Can you give any advice on how to achieve this or anyother approach that could result in a similar result?
Andrew
I have managed to redirect users to a Thank you page with in the site collection http://testtwo but cannot find a way to redirect them back to the original site collection http://testone.
I have used the following code on the submission buton
fd.cancel().click(function(){ STSNavigate('http://testone/SitePages/Home.aspx');return false; });
fd.onsubmit(function (){
$("#aspnetForm").attr('action',location.pathname+'?Source=http://testone/SitePages/Home.aspx');
return true;
});
Can you give any advice on how to achieve this or anyother approach that could result in a similar result?
Andrew
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi Andrew,
The Source parameter expects server relative URLs, so you can redirect users within the current domain only. I'd recommend to create a separate page at http://testtwo that redirects users to another web application e.g. http://testone.com and specify this page in onsubmit handler:
The Source parameter expects server relative URLs, so you can redirect users within the current domain only. I'd recommend to create a separate page at http://testtwo that redirects users to another web application e.g. http://testone.com and specify this page in onsubmit handler:
Code: Select all
fd.onsubmit(function (){
$("#aspnetForm").attr('action',location.pathname+'?Source=/RedirectPage.aspx');
return true;
});
-
- Information
-
Who is online
Users browsing this forum: No registered users and 10 guests