Hi everybody,
I am trying to invoke the download dialog using the following code:

VB Code:
  1. Private Sub nMaintenanceBackup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nMaintenanceBackup.Click
  2.             Try
  3.                 DisplayDownloadDialog("KSIL2005.BAK")
  4.             Catch vException As Exception
  5.                 Session("vErrorMessage") = vException.ToString
  6.                 Response.Redirect(cErrorPageURL & "True")
  7.             End Try
  8.     End Sub
  9.  
  10.     Private Function DisplayDownloadDialog(ByVal vdownload_file As String) As String
  11.         Dim objFileInfo As System.IO.FileInfo
  12.         Try
  13.             objFileInfo = New System.IO.FileInfo(vdownload_file)
  14.             Response.Clear()
  15.             'Add Headers to enable dialog display
  16.             Response.ContentType = "application/octet-stream"
  17.             Response.AddHeader("Content-Disposition", "attachment; filename=" & _
  18.                 objFileInfo.Name)
  19.             'Response.AddHeader("Content-Length", objFileInfo.Length.ToString())
  20.             Response.Flush()
  21.             Response.WriteFile(objFileInfo.FullName)
  22.         Catch
  23.         Finally
  24.             Response.End()
  25.         End Try
  26.     End Function

This code works perfectly fine on my computer which has Windows 2000 Professional SP4. However, when I run it on my client's computers (hosted in the same computer) which have Windows XP Professional and Windows 2000 Advanced Server, it shows up the download dialog for Default.aspx which is the web page where the above code is present. Following are the contents of the download dialog:

---------------------------------------------------------------------------------------

You are downloading the file: Default.aspx from localhost

Would you like to open the file or save it to your computer?

Open Save Cancel More Info

---------------------------------------------------------------------------------------

What could be the problem? What is the solution?