I am working on an application that uses Angular.js
and ASP.NET MVC
. The routes for angular.js
contain a '#'. Some pages in the application can be viewed without needing to log in. These pages however contain URL's to pages in the application that need the user to be logged in. They look like:
<a href="~/#/shop/voucher/6bc1">Want this voucher?</a>
So when these links are clicked, MVC forms authentication redirects to the sign in page with the return URL query string that looks like this:
http://localhost:18030/signin?ReturnUrl=%2f#/shop/voucher/6bc1
So on the sign in pages, when i try to look at the query string I only get '/' for return URL as that is the %2f part. I lose the remaining value because of the #.
If I try to URL encode the link, the # and other '/' characters do get encoded but then the routing gets messed up and I get 404 errors.
Is there anyway to access the full query string value with the '#' in it? I am not sure why forms authentication does not encode the #.