asp.net URL like www.example.com/(S(tx5h2k3fhz3uicis3vbrga55))/mypage.aspx
I want to create asp.net dynamic url webpage lik
a开发者_运维百科sp.net URL like www.example.com/(S(tx5h2k3fhz3uicis3vbrga55))/mypage.aspx
How can I create it ?
URL will be displayed when you set cookielesssession
to "true". Open the web.config file and insert <sessionState cookieless="true" />
.
<system.web>
.....
<sessionState cookieless="true" />
</system.web>
There can be multiple ways to achieve it - basically, you have to generate tokens that need to be used in url (for random tokens, you may use GUIDs), you need to write Http Module that will intercept the url, extract the token from it and pass the control to actual http handler (page) along with the token.
Fortunately, this has already been built into ASP.NET 4 - take a look at ASP.NET Routing.
精彩评论