Monthly Archives: May 2007

TIP: File download using ASP.NET

The following is a method to send a file to browser using ASP.NET   Dim fs As FileStreamDim strPath = "C:\DownloadableFilePath\"Dim strFileName As String = "Filename.pdf"fs = File.Open(strPath & strFileName, FileMode.Open)Dim bytBytes(fs.Length) As Bytefs.Read(bytBytes, 0, fs.Length)fs.Close()Response.AddHeader("Content-disposition", "attachment; filename=" & strFileName)Response.ContentType … Continue reading

Posted in ASP.NET | Tagged , | Leave a comment

TIP: Developing ASP.NET 2.0 applications simultaneously with both C# and VB.NET

If the code (say some classes) is written in C# and if the application is being developed in Visual Basic.NET, you can create a separate folder under the App_Code folder. The folder must be added as a code subdirectory in … Continue reading

Posted in ASP.NET | Tagged , | 7 Comments