c# - Encrypt Url in MVC -


in mvc c# want encrypt url controller name , view name. every time user login, url should different.

i need change this:

http://localhost:6065/home/index 

to this:

http://localhost:6065/aghef54df/sdf54512 

this encrypted text should change if user login next time.

i have tried change routeconfig

routes.maproute(         name: "default1",         url: randomstring() + "/" + randomstring() + "/{rowid}/{operation}",         defaults: new { controller = "home", action = "index", rowid = urlparameter.optional, operation = urlparameter.optional }         ); 

the randomstring() generate random string.

but not change when user login next time. there way sessionid , encrypt , display in url?

or there other way without changing routeconfig?

please refer following stack overflow answer. not directly answer question explains process need create own route handler. need extract action , controller values, decrypt them (using own key?), , add them requestcontext route handling can occur. hope helps!

database selection before routing in asp.net mvc


Comments