Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
| Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 13th, 2004, 05:00 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Refresh Button and View State

Dear All,

I have having a probelm with the refresh button of the browser. I
have an asp.net form which inserts records into a database.The record is successfully inserted. In the back button of the browser I have added the following code

     Response.ExpiresAbsolute = DateAdd(DateInterval.Second, -1, Now)
        Response.Expires = 0
        Response.CacheControl = "no-cache"

 Which gives me a warning message:
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

I have happy with the message. But the problem is that when I press the refresh button.All the data which was sent to the database appears in all the controls. I know that It is impossible to avoid "refresh button" and the data is basically coming from the VIEWSTATE. I tried to disable viewstate
but no luck. I tried to do response.redirect to the same form. But still the data stands in the controls.

Is there some way.I can prevent data from being displayed in the controls

             Any help much appreciated

   Cheers,
   Sunil Sabir





  #2 (permalink)  
Old August 13th, 2004, 09:52 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

When you hit refresh- it's re-sending the data to the page.. if you want a CLEAN page with no data you should have a link on your success page that goes to the form, without sending any data.

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
  #3 (permalink)  
Old August 15th, 2004, 06:26 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

It's rather difficult to manipulate the functionality of the browser. As Hal has suggested, about all you can do is try to make it more intuitive for the user to use a page link or button to go somewhere so they are less tempted to utilize the browser's back button.
  #4 (permalink)  
Old August 16th, 2004, 02:40 PM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

You could make the navigation buttons dissapear- by using a popup box that doesn't have any buttons- but I, as a user, hate that and wouldn't use the system if I could avoid it.


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee


Similar Threads
Thread Thread Starter Forum Replies Last Post
View state problem rabbit3 ASP.NET 2.0 Professional 0 October 23rd, 2007 08:55 PM
Javascript and View State VictorVictor ASP.NET 2.0 Professional 8 April 2nd, 2007 02:34 PM
Refresh GridView Using Refresh Button msbsam ASP.NET 2.0 Professional 0 December 6th, 2006 05:57 AM
Session State|View State|Do I have other options? rockon ASP.NET 1.x and 2.0 Application Design 2 October 5th, 2005 07:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.