asp.net mvc - Access parameters from a URL in ActionResult -


i receiving following url , callback view processtoken controller being displayed:

http://localhost:4151/processtoken/callback#token_type=bearer&access_token=54exxxxxxxxx3ge4 

in callback actionresult code, want access token_type , access_token.

how do this?

it part of fragment , therefore cannot access @ server side.

read this: http://tools.ietf.org/html/rfc2396#section-4

when uri reference used perform retrieval action on identified resource, optional fragment identifier, separated uri crosshatch ("#") character, consists of additional reference information interpreted user agent after retrieval action has been completed.  such, not part of uri, used in conjunction uri. 

you can access query-string-parameters model-binding ken4z pointed out.

you can read hash-part jquery:

var data = window.location.hash.substring(1); $.post('[your_url]', data, function () {     // succeeded, redirect or }); 

Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -