简体   繁体   中英

How to add the user's username / ID to the URL after successful logon?

in my web application I want the page URL to point to current user by his username/ID

so when i change the username the browser moves me to the other username page.

for example like this: www.XYZcom/Member.aspx?userID="012345"

i want to do this because i have a search method and when i click on the resulted hyperlinks, the link returns me back to my own profile, not the username i clicked on.

I'm using c# and ASP.NET.

I hope my question is clear.

HttpContext.Current.Request.QueryString.Add()

include System.Data in your file and use HttpContext to get and set parameters to the url.

You said that you are using c# so this is an example of using C# in the code behind file or controller. You can also accomplish this on the client using java script, but I will wait for a response from you in regards to where you are trying to append to the url.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM