62,040
社区成员
发帖
与我相关
我的任务
分享
Protected Sub files_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles files.Click
Dim di As New System.IO.DirectoryInfo(Server.MapPath("'" + txtPrototypeID.Text + "'"))
' Get a reference to each file in that directory.
If di.Exists Then
Dim fiArr As System.IO.FileInfo() = di.GetFiles()
' Display the names of the files.
Dim fri As System.IO.FileInfo
For Each fri In fiArr
Response.Write("<asp:HyperLink runat='server' NavigateUrl='~/PrototypeManagement/prototype/'3'/'" + fri.Name + "''>" + fri.Name + "</asp:HyperLink >")'这里并没有生成超级链接。请大家帮忙看看是什么原因。如果指定ID的话就不行了。ID号要唯一的嘛。但是不指定它又说缺少ID。怎么解决。
Response.Write("<br>")
Next fri
Else
Response.Write("No attached files")
End If
End Sub
Protected Sub files_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles files.Click
Dim di As New System.IO.DirectoryInfo(Server.MapPath("'" + txtPrototypeID.Text + "'"))
Dim address As String = Server.MapPath("'" + txtPrototypeID.Text + "'")
' Get a reference to each file in that directory.
If di.Exists = True Then
Dim fiArr As System.IO.FileInfo() = di.GetFiles()
' Display the names of the files.
Dim fri As System.IO.FileInfo
Dim i As String = 0
For Each fri In fiArr
Dim hylink As HyperLink = New HyperLink
hylink.ID = "" + i + ""
hylink.Text = "<br>" + fri.Name + "<br>"
hylink.NavigateUrl = "'" + txtPrototypeID.Text + "'\" + fri.Name + ""
attachedfiles.Controls.Add(hylink)
i = i + 1
Next fri
Else
attachedfiles.Controls. = "No attached files"'此块输出还没修改。
End If
End Sub