Page 1 of 1

Redirect on Login (ReturnUrl)

Posted: Wed Sep 28, 2011 11:15 am
by joonyer
Hi all. First I want to say thanks to the great community here. I've learned a lot about AC just from these forums!

For some reason, the "Redirect on Login" feature that uses the ReturnUrl query string variable is not working with any of our custom folders. It works fine for /Admin/ and /Members/, but if I try to go to a custom folder of ours, it will not have a 'ReturnUrl' variable in the query string and no redirect will occur.

Anyone know why this would be? Any help on this is appreciated, thanks! :)

Re: Redirect on Login (ReturnUrl)

Posted: Mon Oct 03, 2011 6:33 am
by mazhar
You need to tell ASP.NET about access rules of your custom folder. For example like the Members folder which is only available to users when they login into system. Lets say you have the same access rule. Then first you need to create a file called web.config in your custom folder with following contents

Code: Select all

<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
  <system.web>
    <authorization>
      <deny users="?"/>
    </authorization>
  </system.web>
</configuration>