0

I've searched the 'Net for this, but didn't find anything definitive to help. Here's the scenario:

I've got a Windows 2003 Server (32-bit) with .NET Framework 4.0. Those things aren't negotiable, and I can't change them.

I'm using Visual Studio 2012 to do the programming and am targeting the 4.0 Framework. Those things ARE negotiable to a point; I also have Visual Studio 2013 Community on my development machine and can use that if there's cause to do so.

Here's the situation:

Several months back, I created a set of pages which allow specific users to update customer information on an intranet site I maintain. The bulk of the site is written in ASP Classic, so when time permits, I try to rebuild the pages in ASP.NET web applications with C#.

This particular set of pages allows users to update customer data, which is displayed in another web application, in a GridView, on a different page. So the users make the changes and the database updates fine. But they can't see the changes when they go back to the GridView page displaying the customer list. It continues to show them the unchanged data.

I found a few answers on SO which indicate the problem is a version of the GridView web app stored in the ASP.NET Temporary Files folder upon first request and compilation. When I look in that folder under C:\Windows\Microsoft.NET, sure enough, there's a folder there with with the name of the update page application.

I can use the command IISRESET /STOP to halt the site, delete the files in the folder, then restart the site with IISRESET /RESTART. That works, and then the GridView will show the updates as it should. But it's a PITA when the user is making several changes.

The type of operation don't matter. Any CRUD operations will not show up on the GridView until after I clear the temporary folder on the server. For instance, the first time I ran into this, someone tried to add a new customer, and when she didn't see the customer in the list, she repeated the action. Same result, so she did it a third time before she finally contacted me. I did the routine above and the record showed up fine.

The changes, of any kind, do make it to the database. The SQL and programming for that aspect doesn't seem to be the problem. Also, this is true on my development machine as well as on end user machines, so that doesn't seem to matter either.

I don't have to clear the user's browser cache. Once I clear the temporary folder on the server, the users can see the changes fine.

I'm trying to avoid dumping that temporary file every day, and even if I do, every time someone uses these update pages this problem resurfaces. It has been suggested in comments I may have improperly implemented my GridView, so there's that.

Any help to figure out how to make the GridView app show the latest and greatest updates as they're made without having to flush that temp file would be epic.

I can share any code needed, so please let me know if you need to see it.

Thanks to any and all who help.

Josh
  • 149
  • 7
  • [prevent a page from being cached](http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers) – Sam Axe Feb 03 '16 at 22:44
  • Have you considered following a full tutorial on GridView? like in [here](https://msdn.microsoft.com/en-us/library/dd548005.aspx) – yazanpro Feb 03 '16 at 22:45
  • @yazanpro - Yes, I'm using that method for making the changes. – Josh Feb 03 '16 at 22:48
  • Good. I still think that you're not implementing your grid the right way. Download [this](https://csaspnetgridview.codeplex.com/) demo project and see how it's implemented. – yazanpro Feb 03 '16 at 22:50
  • @SamAxe, it's not being cached on the browser, but by the server. Is there a way to stop that from happening? or to refresh it after updating automatically rather than the manual way I'm doing it now? – Josh Feb 03 '16 at 22:50
  • @yazanpro, I'm not able to use the demo due to the database requirement. Why do you believe this is a GridView implementation issue rather than an issue with the server caching the app? – Josh Feb 03 '16 at 22:56
  • The demo does use a database. – yazanpro Feb 03 '16 at 23:03
  • @yazanpro, yes, I know, it uses one I'm not able to install. I meant to say, I can't use the demo because of the demo's database requirement. Sorry. – Josh Feb 03 '16 at 23:04
  • Is there an #if DEBUG anywhere in your code that could be the culprit? – IrishChieftain Feb 04 '16 at 00:30
  • @IrishChieftain, No, there isn't. :( – Josh Feb 04 '16 at 13:58

1 Answers1

0

I would look into Signal R, you will find an MSDN example here.

Chris Tucker
  • 383
  • 2
  • 10