Click here to Skip to main content
15,909,440 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

When I try to go to a specific asp.net page by thin code:

Server.Transfer("~/Members/MemberProfile.aspx?UserID=" + Session["UserID_From_SpeCom"].ToString());


I get that error:

Error executing child request for /mosFstWebsite/Members/MemberProfile.aspx.

Why?

Help me please.

Thanks
Posted
Updated 28-Dec-10 4:43am
v2

1 solution

The tilde (~) is used by the ASP.NET engine to resolve links when rendering to a browser. It can't be used with Server.Transer in this manner

You also don't technically need to pass the Session variable via the QueryString since it will still be available to the new page request.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900