473,394 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ASP.NET Error redirect then use Back button (or programmed button)

hi,

I've got an asp.net app. In case of unhandled exceptions, the
web.config is set up to redirect the user to an error page. If the
user then clicks the back button to retry, they have lost all the data
they entered. This could be quite a lot of data. Is there a way to
handle this? I tried SavePageStateToPersistenceMedium but the
LoadPageState is not fired when going back so this doesn't work. And
the back button only works if I set Cacheability to NoCache.

If the page is redirected by me (which it is on a successful post)
then I store the info in a dataset Session variable and provide the
user with a Back button that restores the page using the Session
variable. But if the redirection is because of an error then i cannot
rely on the dataset (as this could be the cause of the error), but how
do I stop the user losing the data.

I could remove tha automatic redirection from the config file and put
in a global page_error handler that issued a javascript alert or just
showed the error on the page but this was a backup for unhandled
exceptions.

Any help appreciated.
Phil
Feb 21 '08 #1
1 1592
Surely those settings are only for unhandled exceptions? If there is a
chance your code will throw an exception, just put it in a try/catch block
and handle the error as appropriate.

"phancey" <de**@2bytes.co.ukwrote in message
news:7c**********************************@60g2000h sy.googlegroups.com...
hi,

I've got an asp.net app. In case of unhandled exceptions, the
web.config is set up to redirect the user to an error page. If the
user then clicks the back button to retry, they have lost all the data
they entered. This could be quite a lot of data. Is there a way to
handle this? I tried SavePageStateToPersistenceMedium but the
LoadPageState is not fired when going back so this doesn't work. And
the back button only works if I set Cacheability to NoCache.

If the page is redirected by me (which it is on a successful post)
then I store the info in a dataset Session variable and provide the
user with a Back button that restores the page using the Session
variable. But if the redirection is because of an error then i cannot
rely on the dataset (as this could be the cause of the error), but how
do I stop the user losing the data.

I could remove tha automatic redirection from the config file and put
in a global page_error handler that issued a javascript alert or just
showed the error on the page but this was a backup for unhandled
exceptions.

Any help appreciated.
Phil

Feb 21 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alex | last post by:
Thank you in advance. My ASP page 1 redirect user to third party's website, after the process at third party is finished, in 3rd party's page, there is one link to route user back to my...
1
by: pmud | last post by:
Hi, Through our ASP.NET website, when i complete the order I get the error,"Redirect URI cannot contain newline characters. " Any idea why its doing that? -- pmud
2
by: robert d via AccessMonster.com | last post by:
I have a module with an error handler section. At the top of the module is the following statement: On Error GoTo Err_Ctrl In the error handler is a conditional If statement based on an error...
2
by: Hellp | last post by:
Any help appreciated. Have users on the local area net work post to an Aspx page. The page process some post data. I would like to return the user's browser back to the sumbit page. I have...
1
by: AA Arens | last post by:
I have a database using a Switchboard. When I place a text on the buttons and push on one of them and go back, the text is fallen behind the button. This happens on some PC's but not on my laptop....
10
by: mjahabarsadiq | last post by:
I would like to reload the page when it is redirected by the browser's Back or Forward button. I tried the following but it does not works. <link rel="prev" href="url"> <link rel="next"...
0
by: alexcole | last post by:
I want to make a button that if i click it, it will redirect it to www.example.com... Can I do it, well i know it is possible, but how?
4
by: shank | last post by:
I have a page that will timeout and crash with a timeout error on line 200. How can I do a redirect instead of the page halting if such an error does happen? thanks
1
by: annir | last post by:
Hi Guys, I used VB.net 2005. In my project I used Drivelistbox, Dirlistbox and Filelistbox so that I can access the drives that I have. I have these problem about the back and forward button,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.