Click here to Skip to main content
15,909,939 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: effective life cycle maintenance Pin
Colin Angus Mackay6-Feb-07 22:34
Colin Angus Mackay6-Feb-07 22:34 
GeneralRe: effective life cycle maintenance Pin
indian1436-Feb-07 22:44
indian1436-Feb-07 22:44 
GeneralRe: effective life cycle maintenance Pin
Colin Angus Mackay6-Feb-07 23:38
Colin Angus Mackay6-Feb-07 23:38 
GeneralRe: effective life cycle maintenance Pin
PSK_6-Feb-07 22:44
PSK_6-Feb-07 22:44 
Questionasp.net/tree nodes Pin
Member 38038996-Feb-07 22:08
Member 38038996-Feb-07 22:08 
AnswerRe: asp.net/tree nodes Pin
gauthee6-Feb-07 22:44
gauthee6-Feb-07 22:44 
Questionc# code for downloading a video file and saving it Pin
sarodam6-Feb-07 22:05
sarodam6-Feb-07 22:05 
AnswerRe: c# code for downloading a video file and saving it Pin
varshavmane6-Feb-07 23:11
varshavmane6-Feb-07 23:11 
Try this but sorry its in VB:

Dim strFolderPath As String = AppDomain.CurrentDomain.BaseDirectory() & "02\TMCoverageArea\"

Dim strFilePath As String
strFilePath = strFolderPath & hlkCoverageArea.Text
DownloadFile(strFilePath, True)

Private Sub DownloadFile(ByVal FilePath As String, ByVal ForceToDownload As Boolean)
'Dim path As Path
Dim strFullFilePath = IO.Path.GetFullPath(FilePath)
Dim strFileName = IO.Path.GetFileName(strFullFilePath)
Dim strExtension = IO.Path.GetExtension(strFullFilePath)
Dim strFileType As String = ""

If Not IsDBNull(strExtension) Then
strExtension = LCase(strExtension)
End If

strFileType = GetFileTypeFromExtension(strExtension)

If (ForceToDownload) Then
Response.AppendHeader("content-disposition", _
"attachment; filename=" + strFileName)
End If

If strFileType <> "" Then
Response.ContentType = strFileType
End If

Response.WriteFile(strFullFilePath)
Response.End()

End Sub






Public Function GetFileTypeFromExtension(ByVal FileExtension As String) As String
Try

Dim strFileType As String = ""

Select Case FileExtension
Case ".htm", ".html"
strFileType = "text/HTML"
Case ".txt"
strFileType = "text/plain"
Case ".doc", ".rtf"
strFileType = "Application/msword"
Case ".csv", ".xls"
strFileType = "Application/x-msexcel"
Case Else
strFileType = "text/plain"
End Select
Return strFileType
Catch ex As Exception

End Try
End Function
Questionunknown error popup in c# web applications Pin
Member 24081286-Feb-07 21:27
Member 24081286-Feb-07 21:27 
AnswerRe: unknown error popup in c# web applications Pin
PSK_6-Feb-07 21:40
PSK_6-Feb-07 21:40 
AnswerRe: unknown error popup in c# web applications Pin
Vsree6-Feb-07 22:25
Vsree6-Feb-07 22:25 
Questionunknown error popup in c# web applications Pin
Member 24081286-Feb-07 21:28
Member 24081286-Feb-07 21:28 
Questionunknown error popup in c# web applications Pin
Member 24081286-Feb-07 21:28
Member 24081286-Feb-07 21:28 
AnswerRe: unknown error popup in c# web applications Pin
Guffa6-Feb-07 21:37
Guffa6-Feb-07 21:37 
QuestionAn Alarming Web Site with Asp.NET and C# - How Can I perform two job every half of an hour? Pin
theklc6-Feb-07 21:01
theklc6-Feb-07 21:01 
AnswerRe: An Alarming Web Site with Asp.NET and C# - How Can I perform two job every half of an hour? Pin
Venkatesh Mookkan6-Feb-07 21:20
Venkatesh Mookkan6-Feb-07 21:20 
GeneralRe: An Alarming Web Site with Asp.NET and C# - How Can I perform two job every half of an hour? Pin
theklc6-Feb-07 22:18
theklc6-Feb-07 22:18 
QuestionDefinition error Pin
nclauder6-Feb-07 20:35
nclauder6-Feb-07 20:35 
QuestionHow can split menu strip in web applications? Pin
elhameh6-Feb-07 20:34
elhameh6-Feb-07 20:34 
Questionhow to rectify unknown error popup in c# web applications Pin
Member 24081286-Feb-07 19:45
Member 24081286-Feb-07 19:45 
AnswerRe: how to rectify unknown error popup in c# web applications Pin
gauthee6-Feb-07 20:17
gauthee6-Feb-07 20:17 
AnswerRe: how to rectify unknown error popup in c# web applications Pin
Vsree6-Feb-07 20:39
Vsree6-Feb-07 20:39 
GeneralRe: Pls help Pin
Ishwarya M6-Feb-07 19:27
Ishwarya M6-Feb-07 19:27 
GeneralRe: Pls help Pin
Ishwarya M6-Feb-07 19:32
Ishwarya M6-Feb-07 19:32 
GeneralRe: Pls help Pin
Sandeep Akhare6-Feb-07 19:37
Sandeep Akhare6-Feb-07 19:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.