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.