Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass URL's with hash value for redirection [duplicate]

Possible Duplicate:
How to get Url Hash (#) from server side

I'm having some trouble to get the hash value from a variable.

I'm using the default action in the AccountController

[HttpPost]
public ActionResult LogOn(LogOnModel model, string returnUrl) { ... }

but if I pass this link on:

http://localhost:1357/none/Account/LogOn?returnUrl=a/b/c#day-22

I can never catch the #day-22 value

below it's a breakpoint after the login:

enter image description here

I never get the hash value on the HttpContext.Request.Url object.

What can I do to forward the user to the correct URL with the hash part?

like image 886
balexandre Avatar asked Feb 16 '26 03:02

balexandre


2 Answers

You need to urlencode it.

Try: http://localhost:1357/none/Account/LogOn?returnUrl=a/b/c%23day-22

like image 176
drch Avatar answered Feb 18 '26 16:02

drch


This is not possible because the URL fragment (the bits after the #) is not sent from the browser to the server.

like image 34
João Angelo Avatar answered Feb 18 '26 17:02

João Angelo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!