returnURL removing friendlyURL values

65 Views Asked by At

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

1

There are 1 best solutions below

0
On BEST ANSWER

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))