Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I have written the code given below.

I want to know how I can write the statement instead of what is written in bold.

It is basically for download doc file from database.

Can anybody help me?

(Well actully I get error "Bad Request")


VB
Public Sub FillMaterials(ByVal chnode As TreeNode, ByVal chid As Integer, ByVal catid As Integer, ByVal subcat1 As Integer, ByVal subcat2 As Integer, ByVal subcat3 As Integer, ByRef i As Integer)
       Dim dschildlv2 As New DataSet
       objMaterial.category = catid
       objMaterial.subcat = subcat1
       objMaterial.subcat1 = subcat2
       objMaterial.subcat2 = subcat3
       dschildlv2 = objMaterial.SearchItem
       If dschildlv2.Tables(0).Rows.Count > 0 Then
           Dim j As Integer = 0
           For Each childrow As DataRow In dschildlv2.Tables(0).Rows
               Dim newNode2 = New TreeNode(dschildlv2.Tables(0).Rows(j).Item("MaterialTitle").ToString, dschildlv2.Tables(0).Rows(j).Item("MaterialID").ToString)
               newNode2.NavigateUrl = "<a href='javascript:void(0);' onclick=""javascript:return winfiledownload('" & childrow.Item("materialid").ToString & childrow.Item("materialfile").ToString & "','material');"">" & childrow.Item("materialTitle").ToString & ""
               'newNode2.NavigateUrl = childrow.Item("MaterialID").ToString & childrow.Item("MaterialFile").ToString
               newNode2.PopulateOnDemand = False
               newNode2.SelectAction = TreeNodeSelectAction.Select
               chnode.ChildNodes.Add(newNode2)
               j = j + 1
           Next
       End If
   End Sub



Thanks in Advance
Posted
Updated 23-Jun-10 22:05pm
v2
Comments
Dalek Dave 24-Jun-10 4:05am    
Edited for spelling, grammar and readability.

1 solution

I filled in values xxx, yyy and zzz for your childrows :

"<a href='javascript:void(0);' onclick="javascript:return winfiledownload('xxxyyy','material');">zzz"


That looks like a Bad request to me

Cheers
 
Share this answer
 
Comments
narendrarathod 24-Jun-10 3:28am    
Thank you for giving me reply well can u tell me how can i correct it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900