tags:

views:

69

answers:

2

I have a FileUpload control in the Source page. On the Upload button handler, I read the file into memory (after doing some validations) and since it's always going to be a TXT file, I create a string that I need to pass to the Destination page.

I thought of using Cross Page postback and set the PostBackUrl property of the upload button. But it appears that the breakpoint in the Upload button handler is never hit. It directly goes to the Page_Load in the Destination page.

If I can't use Cross Page postback and don't want to use Session or the database, how do I pass this string from Source page to the Destination page?

Anyone?

A: 

You can use HTTPContext object to do this. Just add your values to context like this

Context.Items["Myvariable"] = "myValue";

See The HttpContext Items Collection

rahul
With the HTTPContext object, I can pass data between pages?
Yes, you can pass data.
rahul
Well, I need to use Server.Transfer with a Context object. I would like to do a Response.Redirect.
A: 

I ended up using Session