FormsAuthentication.GetRedirectUrl() returns only first parameter

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default FormsAuthentication.GetRedirectUrl() returns only first parameter

    It appears that FormsAuthentication.GetRedirectUrl() only returns the first
    parameter for the original target URL. For example, if the original target
    URL is:

    /MyPage.aspx?a=b&c=d

    and the user is redirected to the login page, a call to
    FormsAuthentication.GetRedirectUrl() in the login page returns:

    /MyPage.aspx?a=b

    Any ideas as to why this may be?

    Thanks,

    Brian Adkins
    [url]http://www.MLSClassified.com[/url]


    Brian Adkins Guest

  2. Similar Questions and Discussions

    1. Cookie not persisted w/o call to GetRedirectUrl()
      I am using forms authentication. I do not have default.aspx nor do I want one as I am using multiple roles and I want to redirect the user after...
    2. FormsAuthentication.GetRedirectUrl returns non-existing page ??
      hi, i have copied to my PC an ASP.NET project that was developed on a different PC. I have managed to create a virtual directory and build the...
    3. Date Parameter For Saved Parameter Queries
      Hi again, I finally got to using saved parameter queries in my application (a big thank you to Bob Barrows for helping me with this). Currently...
    4. #26132 [Opn]: pg_fetch_object returns NULL on serial and INT in record but returns strings NP
      ID: 26132 User updated by: steven at pearavenue dot com Reported By: steven at pearavenue dot com Status: Open Bug...
    5. #26132 [NEW]: pg_fetch_object returns NULL on serial and INT in record but returns strings NP
      From: steven at pearavenue dot com Operating system: Redhat 9.0/Apache 2.0 PHP version: 4.3.4 PHP Bug Type: PostgreSQL...
  3. #2

    Default Re: FormsAuthentication.GetRedirectUrl() returns only first parameter

    I was able to create a workaround that I've included below, but if anyone
    has additional insight into this problem, please post to the group.

    StringBuilder redirectUrl =
    new StringBuilder(FormsAuthentication.GetRedirectUrl(" ", false));

    NameValueCollection coll = Request.QueryString;

    foreach (string key in coll.AllKeys)
    {
    if (string.Compare(key, "returnurl", true) != 0)
    {
    String[] values = coll.GetValues(key);

    if (values.Length > 0)
    {
    string pair = key + "=" + values[0];

    if (redirectUrl.ToString().IndexOf(pair) < 0)
    {
    redirectUrl.Append("&" + pair);
    }
    }
    }
    }


    "Brian Adkins" <brian> wrote in message
    news:ex08LHm%23DHA.1212@TK2MSFTNGP12.phx.gbl...
    > It appears that FormsAuthentication.GetRedirectUrl() only returns the
    first
    > parameter for the original target URL. For example, if the original
    target
    > URL is:
    >
    > /MyPage.aspx?a=b&c=d
    >
    > and the user is redirected to the login page, a call to
    > FormsAuthentication.GetRedirectUrl() in the login page returns:
    >
    > /MyPage.aspx?a=b
    >
    > Any ideas as to why this may be?
    >
    > Thanks,
    >
    > Brian Adkins
    > [url]http://www.MLSClassified.com[/url]
    >
    >

    Brian Adkins Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139