Extranet Default Redirect

Topics: General, Standard packages, Troubleshooting
Sep 2, 2011 at 9:04 PM

Can someone help me with a user flow issue?

When you navigate to a protected page on your site, it redirects you to the login page. After logging in successfully to the Extranet, it redirects you to the value in the "ReturnUrl" Query String parameter.

However, when you navigate you to the Login page directly, it just refreshes the page.

I noticed that there's a call to the Composite.Web.Request.QueryStringValue function in the Composite.Community.Extranet.LoginForm function. I have hard-coded a value but when the form is submitted, it still just refreshes the page. Is there a simple way to set a Default Redirect on the Login Form?

Sep 4, 2011 at 2:09 PM


It looks like Composite.Web.Request.QueryStringValue.Return URL  function call  is not used in the Composite.Community.Extranet.LoginForm xstl function, and the ReturnUrl logic implemented in Composite.Community.Extranet.User.Login() method. 

You can try next solution:

When ReturnUrl query parameter is empty, the Login page is refreshed and "?login=true" query is added after successful login.

1. Edit Composite.Community.Extranet.LoginForm xstl function, add function call Composite.Web.Request.QueryStringValue , Parameter name = login

2. On the template tab at the bottom there is  <msxsl:script implements-prefix="csharp" language="C#" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> section, add additional c# method, for example:

 public void DoDefaultRedirect()
      HttpContext.Current.Response.Redirect("/Home.aspx", false);

3. On the template tab put somewhere next xslt code:

<xsl:if test="/in:inputs/in:result[@name='QueryStringValue'] = 'true'">
            <xsl:value-of select="csharp:DoDefaultRedirect()" />

Mar 6, 2012 at 9:05 PM
Edited Mar 6, 2012 at 9:07 PM

I'm also trying accomplish the same task. When a user is authenticated I want to pass a param that will redirect the user e.g. you currently have "/Home.aspx" as a static value, but I want to pass a var from the login page.

Also, I cant seem to get the example above to work. When I do the part 
1. (add the QueryStringValue, param login) the ?login=true dissappears from the url.
Mar 7, 2012 at 7:56 AM

Hello, gcampanis

When you navigate directly to the  Login page ("ReturnUrl" Query String parameter is absent) and after logging successfully to the Extranet, you will stay on the same Login page,  the Login page will be just refreshed and "login" query parameter will be  added (the URL will look like this: http://localhost/Login?login=true) and you can use this query parameter to implement your custom redirect logic from the Login page.

But if you navigate to the Login page from some other page, for example by  using Login link from the login status bar, the Login page URL will have "ReturnUrl" Query String parameter, and then after logging successfully to the Extranet you will be just redirected the the URL specified in "ReturnUrl" Query String parameter. In this case, the "?login=true" query parameter will be  absent.