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.
 
Thanks Scott - thats the info I was looking for...

Thanks

Donal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top