0

When users login from the main page it sends an id as part of the friendly URL

e.g.

https://MyDomain.com/Secure/Landing/23

Where landing is Landing.aspx and 23 is the ID. This is redirected back to the login page, but now we have

https://MyDomain.com/Secure/Login?ReturnUrl=%2fSecure%2fLanding%2f23

At the login page

Dim vList As IList = Request.GetFriendlyUrlSegments()

returns 0 and cannot set the ID.

What is the best way to handle with friendly urls? Or do I have to resort back to sending it as a query string?

Thanks

gchq
  • 1,603
  • 2
  • 27
  • 52
  • Why do you want to get the segments from the login page? Why not grab the path from the query string and then redirect to that path upon successful login? – mason Nov 27 '14 at 03:43
  • Hey Mason - The ID part is critical to the login process – gchq Nov 27 '14 at 13:31

1 Answers1

0

In the end this was the only way I could find of getting round the issue

 Dim vURL As String = Request.Url.Query
 Dim vSubString As String = vURL.Substring(vURL.Length - 1)
 Dim i As Integer = 1
        Do While IsNumeric(vSubString)
            vSubString = vURL.Substring(vURL.Length - i)
            i += 1
        Loop
 vSubString = vURL.Substring(vURL.Length - (i - 2))
gchq
  • 1,603
  • 2
  • 27
  • 52