3

I am currently trying to add a variable to the url using Server.Transfer. I need to use Server.Transfer as I need to keep form post data which is why I can't use Response.Redirect.

I am using Server.Transfer("add_account.aspx?error=userNotFound"); but the variable is not being added to the URL.

Thanks for your help.

1 Answer 1

4

Usually with Server.Transfer, we use context to pass data around:

Context.Items["error"] = "UserNotFound";
Server.Transfer("add_account.aspx");

This is a state container like Session and Application, but it only persists for the current request and then goes away.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.