Setting form element values in an exception handler

S

Sky Fly

Hello,

I have a web form which, when an exception is thrown in its
codebehind, should be redirected to another from to display
the details of the error message.

I have a special asp textbox in this form which is invisible
and which will be assigned the value of the error message in
the exception handler so that in the Page_Load of the
new web form, the value of the error message is retrieved
from the Request.Form collection.

However, nothing seems to work. I had to abandon the non-visible
textbox in favour of a hidden input (since it seems that non
visible text boxes aren't included in the Request.Form collection).
No matter - I cannot seem to get the error message passed
from one form to another. It's strange, because I can see
values that I assign in other elements of the form (outside of
the exception) passed to the Request.Form collection.

Can anyone shed any light on what's going on here?

TIA,
 
G

Guest

Your posting is a bit unclear.

Are you attempting to Transfer to a Different Page, hence the reference to
"another from" (which i assume was meant to be another form)
If you are attempting to Transfer to a different web form then you may want
to use Server.Transfer() and explicitly tell it to Preserve the Forms. Read
the MSDN Documentation for more info and sample code.


Hope this helps, Posting is provided as is
 
S

Sky Fly

Hello,

Sorry if the post was unclear. Yes, I am trying to Transfer to a
different page.

I have tried using Server.Transfer (with the preserve value set to
'True'), but this doesn't seem to make any difference.

Any other ideas?
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top