A
Anne
hie, in my web application, i have a dropdownlist, and a
button. i want to be able to select from the list, and
whatever item that i have selected, i want to use the item
value for manipulation. once i have selected from the
list, the button is clicked and the application will
display an excel file. for example, i chose number 8 in my
dropdownlist, and the application will display the excel
file with the number 8. i also need to use the item
selected to search for my excel files. How can i code this
function? i've tried coding it as below, but got an error
when i tried to append the item selected to a string
(strExcel). what can i do to make my program works as i
want it to? anybody got an idea on how to solve this?
thanx!
Private Sub btnOK_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnOK.Click
Dim WW As New ListItem()
WW = wwList.SelectedItem()
strMyPath = "C:\Inetpub\wwwroot\Final_MR"
If fso.FolderExists(strMyPath) Then
fso.GetFolder(strMyPath)
For Each sFl In fso.GetFolder(strMyPath).Files
If sFl.Name Like ".xls" Then
strtmp = fso.GetFileName(sFl.Name)
intlngth = Len(strtmp) - 5
strName = Microsoft.VisualBasic.Left
(strtmp, intlngth)
strExcel = strName & WW & ".xls"
End If
Next
Response.Redirect
("C:\Inetpub\wwwroot\Final_MR\" & strExcel)
End If
End Sub
button. i want to be able to select from the list, and
whatever item that i have selected, i want to use the item
value for manipulation. once i have selected from the
list, the button is clicked and the application will
display an excel file. for example, i chose number 8 in my
dropdownlist, and the application will display the excel
file with the number 8. i also need to use the item
selected to search for my excel files. How can i code this
function? i've tried coding it as below, but got an error
when i tried to append the item selected to a string
(strExcel). what can i do to make my program works as i
want it to? anybody got an idea on how to solve this?
thanx!
Private Sub btnOK_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnOK.Click
Dim WW As New ListItem()
WW = wwList.SelectedItem()
strMyPath = "C:\Inetpub\wwwroot\Final_MR"
If fso.FolderExists(strMyPath) Then
fso.GetFolder(strMyPath)
For Each sFl In fso.GetFolder(strMyPath).Files
If sFl.Name Like ".xls" Then
strtmp = fso.GetFileName(sFl.Name)
intlngth = Len(strtmp) - 5
strName = Microsoft.VisualBasic.Left
(strtmp, intlngth)
strExcel = strName & WW & ".xls"
End If
Next
Response.Redirect
("C:\Inetpub\wwwroot\Final_MR\" & strExcel)
End If
End Sub