Response.redirect output stream binary

I need C # code to do a redirect and pass data to it.

Can you point me in the right direction? how to write binary data in httpcontext, redirect it to http: //myserver/hello.aspx and return that binary on page load http: //myserver/hello.aspx

thanks in advance

0


a source to share


2 answers


FYI

I got the solution from another forum

There is no way to do such a thing with a redirect.



there are two possible ways:

use querystring as you mentioned use server.redirect and use "previous page"

thanks anyway

0


a source


If it is not a large amount of data (there are limits on the length of the url), you can serialize your data and pass it as a querystring parameter. You are redirected to http: //myserver/hello.aspx? Param1 = 0102030405060708090A0B0C on page load, you read the request and deserialize it.



Not sure, but I think to remember that the default maximum size for a querystring is 2048 bytes, so anything close to 1K of binary data will be your maximum if you serialize a hex string. You can try base64, but you will need to sanitize it as it will include invalid characters (e.g. /, and? And =).

0


a source







All Articles