473,563 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Back" button and ViewState

Hello All,

Most of you might be familiar with this problem i.e, viewstate is lost
whenever we navigate from the one page to another. Does anyone have a remedy
for this problem?

On Page A, I have a datalist which has a "select" link for each row(I have
1000's of such rows). When a user clicks a particular select link, I am
redirecting him to Page B(this redirection is being done in
Datalist_ItemCo mmand). Once on Page B, when user clicks "Back" button in the
browser and clicks on another "Select" link, the datalist_ItemCo mmand is not
being fired. He is forced to click the "Select" link twice.

Does anyone for any alternatives for this problem?

Thanks!
Mar 6 '06 #1
5 3655
When user clicks on "Back" button, the page is being served from the
browser's cache. The server does not get a chance to participate. You can
disable page caching on client by adding the required pragma settings in
headers. This should help.
"Diffident" <Di*******@disc ussions.microso ft.com> wrote in message
news:FB******** *************** ***********@mic rosoft.com...
Hello All,

Most of you might be familiar with this problem i.e, viewstate is lost
whenever we navigate from the one page to another. Does anyone have a
remedy
for this problem?

On Page A, I have a datalist which has a "select" link for each row(I have
1000's of such rows). When a user clicks a particular select link, I am
redirecting him to Page B(this redirection is being done in
Datalist_ItemCo mmand). Once on Page B, when user clicks "Back" button in
the
browser and clicks on another "Select" link, the datalist_ItemCo mmand is
not
being fired. He is forced to click the "Select" link twice.

Does anyone for any alternatives for this problem?

Thanks!

Mar 6 '06 #2
Hello Naveen,

When I tried adding the following line of code:
Response.Cache. SetCacheability (HttpCacheabili ty.NoCache);

to prevent the browser from caching the page. When I did this, I got this
error message in IE:

-----
Warning: Page has Expired The page you requested was created using
information you submitted in a form. This page is no longer available. As a
security precaution, Internet Explorer does not automatically resubmit your
information for you.

To resubmit your information and view this Web page, click the Refresh
button.
------

In Firefox, I am getting a "page cannot be displayed" error.

Any pointers?

Thank you.

"Naveen K Kohli" wrote:
When user clicks on "Back" button, the page is being served from the
browser's cache. The server does not get a chance to participate. You can
disable page caching on client by adding the required pragma settings in
headers. This should help.
"Diffident" <Di*******@disc ussions.microso ft.com> wrote in message
news:FB******** *************** ***********@mic rosoft.com...
Hello All,

Most of you might be familiar with this problem i.e, viewstate is lost
whenever we navigate from the one page to another. Does anyone have a
remedy
for this problem?

On Page A, I have a datalist which has a "select" link for each row(I have
1000's of such rows). When a user clicks a particular select link, I am
redirecting him to Page B(this redirection is being done in
Datalist_ItemCo mmand). Once on Page B, when user clicks "Back" button in
the
browser and clicks on another "Select" link, the datalist_ItemCo mmand is
not
being fired. He is forced to click the "Select" link twice.

Does anyone for any alternatives for this problem?

Thanks!


Mar 6 '06 #3
Thus wrote Diffident,
Hello Naveen,

When I tried adding the following line of code:
Response.Cache. SetCacheability (HttpCacheabili ty.NoCache);
to prevent the browser from caching the page. When I did this, I got
this error message in IE:

-----
Warning: Page has Expired The page you requested was created using
information you submitted in a form. This page is no longer available.
As a
security precaution, Internet Explorer does not automatically resubmit
your
information for you.
To resubmit your information and view this Web page, click the Refresh
button. ------

In Firefox, I am getting a "page cannot be displayed" error.


That's not an error. It's just a warning that going "back" means resending
previously submitted data again, which might be harmful if your web application
doesn't deal with such a case.

Cheers,
--
Joerg Jooss
ne********@joer gjooss.de
Mar 7 '06 #4

Joerg,

Do you know how I can disable this warning in IE?

Thanks!

"Joerg Jooss" wrote:
Thus wrote Diffident,
Hello Naveen,

When I tried adding the following line of code:
Response.Cache. SetCacheability (HttpCacheabili ty.NoCache);
to prevent the browser from caching the page. When I did this, I got
this error message in IE:

-----
Warning: Page has Expired The page you requested was created using
information you submitted in a form. This page is no longer available.
As a
security precaution, Internet Explorer does not automatically resubmit
your
information for you.
To resubmit your information and view this Web page, click the Refresh
button. ------

In Firefox, I am getting a "page cannot be displayed" error.


That's not an error. It's just a warning that going "back" means resending
previously submitted data again, which might be harmful if your web application
doesn't deal with such a case.

Cheers,
--
Joerg Jooss
ne********@joer gjooss.de

Mar 7 '06 #5
Thus wrote Diffident,
Joerg,

Do you know how I can disable this warning in IE?


You cannot disable that warning. Instead, think about a server-side solution
to avoid that warning, like using Redirect-After-Post.

Cheers,
--
Joerg Jooss
ne********@joer gjooss.de
Mar 7 '06 #6

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

Similar topics

5
2266
by: Nick Li | last post by:
Hi, I need to create a html page so that "Back" button(or some other button) is disabled in IE browser. I would appreciate your help. Nick Li
1
5803
by: JJA | last post by:
When my webserver does not process a user's change because of an invalid password, I inform the user and I want to present them a button for a retry: <TR id=continuebuttonrow> <td width="05%">&nbsp;</td> <TD width="90%" align=center valign=middle colspan=2> <BUTTON TYPE=BUTTON ONCLICK="location.href='<% =...
1
2070
by: Tom Youngquist | last post by:
Does anyone know the command to "imitate" the "Back" button on a browser in .NET. I have looked in the Redirect but can't seem to find anything. I can re-direct to a specific page but my users come from differnet places so would like to put a "Back" button on the page. Thanks. Tom Youngquist Tom_Y@ix.netcom.com
5
2423
by: Dani | last post by:
Hello everybody, I have some code that disables form elements on body load, but I notice when I hit the "back" button, I need to re-enable the form elements (that is done by clicking on a radial button). Is there any way I can keep the form for disabling every time a user hits the back button and "remember" what elements should be enabled?...
12
10155
by: VB Programmer | last post by:
I know some sites will display the following message if you click on the BACK button in your browser. How do I implement this feature? Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically...
2
3793
by: Leszek Taratuta | last post by:
Hello, I am using the following code to prevent users to see the previous pages: Response.CacheControl = "no-cache"; Response.AddHeader( "Pragma", "no-cache" ); Response.Expires = -1; When users select the "Back" button in IE, they see the message:
11
2678
by: John A Grandy | last post by:
asp.net 1.1 ie 6 how to lock-out the user from clicking the browser "Back" button ?
8
23222
by: Coleen | last post by:
Yes, I know why would I want to create a back button when there is one on the browser? Because that's what the users want! they want a "Previous" button that they can click from any web page in our application that will do the exact same thing as the Back button in the browser. Can anyone give me any suggestions on how to do this using VB...
0
3516
by: sagarp86 | last post by:
How to lock / deactivate "Refresh" and "Back" button on browser. Problem is in voting application. Once we click for a vote application goes to next page and increament one vote in the database. But when we click on "Refresh" button on the browser, the query is fired again and again one vote is added un-necessarily..Only one vote should be...
0
7664
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7885
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7638
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7948
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.