0

The SL3 DataGrid has a download XLS column to download the details of the record in Excel format. On click of the Download button, first the user is prompted with a SaveFileDialog to select the file and then a WCF call is made to fetch the details of the selected record. Using 3rd party excel helper library, the records are added to an excel sheet and the file is saved.

The problem is that when the Session has timed out (say, due to idleness), the click functions perfectly well, prompting the user to specify the file to save, and then a redirect is made to the login page (as expected, since we are handling the not authenticated errors etc).

However, the user is now in an illusion that an empty Excel file has been downloaded.

So, is there a way to detect from Silverlight page, if the Session has timed out? And thereby showing the SaveFileDialog only when the Session is available.

Vaibhav
  • 1,156
  • 2
  • 12
  • 27

1 Answers1

0

You can probably send the heartbeat from Silverlight to ASP.NET. This is very common issues in Ajax world as well. As you can use Javascript in Silverlight as well, you may want to check this solution Keeping ASP.NET Session Open / Alive

If you dont like to JS then you can either use HttpWebRequest or WebClient to communicate with asp.net ...

Community
  • 1
  • 1
Michael Sync
  • 4,834
  • 10
  • 40
  • 58
  • Hi Michael, thanks for the reply. My intent is not to keep the session alive, but rather to ensure that I dont popup a SaveFileDialog when the session no longer exists, since it would anyways be redirecting to the login page (expected). Wondering if there are any means of knowing on button click if the session is alive or expired? – Vaibhav Aug 02 '11 at 06:38