This issue presented itself in my application by failing to load any CSS for any of the Telerik controls I was using. Telerik loads it’s CSS using WebResource.axd. As I’m in Australia and the servers I uploading to are behind the Australian timezones, the call to the WebResource.axd would return a 404 error. Once the time on the server caught up to the compile time of my site assembly files, the CSS would start displaying.
I found 2 workarounds before finding a permanent solution.
Workaround 1: Change my PC’s timezone to Samoa (this first timezone in the list) and deploying my application. Obviously not ideal.
Workaround 2: Deploy the site to Staging and wait until several hours past and the site started working, then Swap VIP to Production. Also no ideal.
The solution I found to resolve the issue involved using the touch.exe app found at http://www.touchdotexe.com/ to touch the assembly dll file to update it to the current time on the server after the app had been deployed.
To do this I added the touch.exe file and a setup.cmd file to the root of my app, set the build action on the 2 files to Content and the Copy to Output Directory to Copy always.
I then added a startup task to the Azure Project’s ServiceDefinition.csdef file to execute the setup.cmd file at role startup.
In a project I’m working on, I had to create a Facebook style notification system. I wanted the user to be able to enter a status and click the add button and have the list of notifications below it update with their most recent post. That is simple enough to do, all I had to do was to add the notification, clear the textbox then call the updateNotifications function in my button_click code behind method. This all had to be very smooth to the eye so i added the usual updatepanel around the textbox, button and div that listed the notifications.
As well as that, I also wanted the notifications system to automatically update with other users notifications within the same group. So I added a Time control to the mix and set it to refresh the notifications list every 10 seconds.
This seemed to work well until I was half way through typing a new notification when the timer triggered and refreshed the notification list. As the textbox was inside the updatepanel it stopped letting me type any text while it refreshed.
So then I thought that I’d move the textbox outside the updatepanel so it wasn’t impacted when the timer refreshed the list.
The only problem now is that because the submit button to add a new notification was inside the updatepanel and the textbox was outside the updatepanel the textbox could no longer be cleared on the partial postback. My txtNotification.Text = String.Empty; was being ignored.
I can’t quite remember the next thing I tried but it obviously didn’t work because now the whole page was refreshing everytime the timer triggered.
In the end I remembered about the UpdateMode property on the update panel. I set the updatemode to conditional around my textbox/button updatepanel and always on the notification list/timer updatepanel. That way the timer triggers updated the notification list without upsetting the textbox and submitting the add button updated the list and cleared the textbox. Perfect result.