Posted on: 4/21/2011 1:02:03 PM | Views : 394

hi...,
I have a link button inside a gridview which allows to download a file by clicking on it. i'm woriking with,
.NET Framework 4(Visual Studio 2010)
Windows 7 platform
the code runs without any errors but nothing happens when i click on the link.
I tried both IE and FireFox.
Code:
FileInfo file = new FileInfo(FilePath); if(File.Exists(FilePath)) { Response.ClearContent(); Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name); Response.AddHeader("Content-Length", file.Length.ToString()); Response.ContentType = file.Extension.ToLower(); Response.TransmitFile(file.FullName); Response.End(); }

I have used the same code earlier with .net Framework 3.5, on windows 7 platform.
but it worked well.

i would appreciat ...

Go to the complete details ...