ReturnUrl returns only the first parameter of the querystring after login

Posted on 2009-02-18
Last Modified: 2012-05-06
When calling my logon.aspx page I specify the ReturnUrl to be like
~/Admin/Logon.aspx?ReturnUrl=~/MyPage.aspx?param1=" + p1+ "&param2=" + p2
however after a successfull logon MyPage.aspx url contains only the first parameter and the second one dissapears!
I would expext the return url either to have all the parameters or none, but it returns only the first.
Any suggestion?
Question by:Palahniuk
    LVL 13

    Accepted Solution

    try wraping your params like

    +server.urlencode( p2)
    LVL 16

    Assisted Solution


    Expert Comment

    The problem (I believe) is that if you are redirecting to a page that you are pulling from the querystring, it will truncate off the last ampersand.  For instance,

    If you use Response.Redirect(Request.QueryString["returnURL"]), then it thinks that 'returnURL=' is the part of the querystring you want, and &param2=B is just another segment of the original url string.

    Hope that helps,


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now