Passing exception to another page?

  • Thread starter Thread starter Donal McWeeney
  • Start date Start date
D

Donal McWeeney

Hi,

Whats the best way to pass an exception object and some string params from
one aspx page to another. I cant use the Session or Application objects? Is
it possible to use the Context.Items collection?

Thanks

Donal
 
Hi Donal:

You can pass an object reference along in the Context.Items collection
if you are using Server.Transfer. Context.Items only sticks around for
the duration of the request, so if you do anything that creates a new
request (like Response.Redirect) you'll lose anything in the Items
collection.

Note: there is also HttpServerUtility.GetLastError that can be used in
some scenarios.
 
Back
Top