I have created a website using Visual Studio 2010 and I have several hundred users, each with their own dedicated page. After the user logs in, I want them to be redirected to their dedicated page. For example, user 2460, after logging in, should be redirected to 2460.aspx. I cant seem to figure out how to accomplish this effectively. The farthest I've gotten is to redirect everyone to the same page after logging in. Any thoughts?

有帮助吗?

解决方案

If you know the page that they have to go to, just build the URL and do a Response.Redirect to it.

var userId = GetUserId(); // However you get this value

// After they log In
Response.Redirect("~/" + userId + ".aspx");
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top