views:

166

answers:

2

I created a very simple ASP.NET application with one ASP.NET textbox control, ASP.NET button control and a ASP.NET gridview control.

When my client loads the application for the very first time, they enter in some text and press enter. The application does not load the results and clears the text box control. When they close their browser and re-open the application, it works as expected.

The cause of the weird behavior was their browsing history setting for "Check for newer version of stored pages" is set to automatically. When it is set to "Every time I visit the webpage", the application works the first time they load it in their browser.

What can I do programmatically to make it work everytime the client uses the application?

A: 

That's not normal, have you checked the date/time on the server to make sure it's correct? You can use meta tags to tell the browser not to cache the page, but since this is not the default behavior for a ASP.NET page, you'd be creating a working versus a fix. Regardless of what you decide to do, here is the meta tag to force no caching.

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
Zachary
That did not resolve the issue.
Michael Kniskern
I checked the date/time on the server it is in sync with my workstation. I was able to recreate the same behavior on my machine.
Michael Kniskern
A: 

Pressing enter in text box is not the same as clicking a button in the world of ASP.NET. Try clicking the button to see if it resolves the issue.

If it does set DefaultButton property of the form:

<form id="form1" runat="server" DefaultButton="Button1">

See Default Focus, Buttons and Validation Errors with ASP.NET 2.0 by Scott Guthrie.

Pavel Chuchuva
I did set the default button property for the form and it still performs the same odd bahavior on either by clicking the submit button or pressing the enter key
Michael Kniskern