Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

returnUrl doesn't work

$
0
0

I am using t he login from the vs2012 web site starter code, so the code is supplied. I  However, when you debug it the returnUrl is null. Then whenyou get tothe line where it asks if returnUrl is null. it skips the if statement and you are stuck on the login page. The login view  recognizes that  you  are logged in. I thought that the returnUrl is automaticallly sent to the login page?

 

protected void Page_Load(object sender, EventArgs e)
    {
        RegisterHyperLink.NavigateUrl = "Register";
        OpenAuthLogin.ReturnUrl = Request.QueryString["ReturnUrl"];

       var returnUrl = HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
        if (!String.IsNullOrEmpty(returnUrl))
        {
            RegisterHyperLink.NavigateUrl += "?ReturnUrl=" + returnUrl;
        }
    }


    protected void Unnamed1_LoggedIn(object sender, EventArgs e)
    {
        var returnUrl = HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
        if (!String.IsNullOrEmpty(returnUrl))
        {
            RegisterHyperLink.NavigateUrl += "?ReturnUrl=" + returnUrl;
            Response.Redirect (RegisterHyperLink.NavigateUrl);
        }
    }


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>