By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,136 Members | 1,087 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,136 IT Pros & Developers. It's quick & easy.

Setting form element values in an exception handler

P: n/a
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,

--
Akin

aknak at aksoto dot idps dot co dot uk
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
"Sky Fly" <no****@blackhole.com> wrote in message
news:c5*************@ID-18325.news.uni-berlin.de...
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,

--
Akin

aknak at aksoto dot idps dot co dot uk

Nov 18 '05 #2

P: n/a
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?
<jo*****@driver.net> wrote in message
news:e0**************@TK2MSFTNGP12.phx.gbl...
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
"Sky Fly" <no****@blackhole.com> wrote in message
news:c5*************@ID-18325.news.uni-berlin.de...
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,

--
Akin

aknak at aksoto dot idps dot co dot uk


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.