For Each file As String In IO.Directory.GetFiles(Server.MapPath(strDir)) lblDownloads.Visible = True If Not (IO.Path.GetFileName(file).EndsWith(".aspx")) Then Dim lnk As New HyperLink PlaceHolder1.Controls.Add(GetLiteral("<br>")) lnk.ID = "lnk" & i.ToString() lnk.NavigateUrl = strDir & IO.Path.GetFileName(file) lnk.Text = Mid(IO.Path.GetFileName(file), 1, (IO.Path.GetFileName(file)).IndexOf(".")) ' MsgBox(lnk.Text) If (lnk.Text = "Downloads") Then GoTo bypass End If If (lnk.Text = "Web") Then GoTo bypass End If PlaceHolder1.Controls.Add(lnk) End If bypass: i += 1 'End If Next End Sub Private Function GetLiteral(ByVal text As String) As Literal Dim rv As Literal rv = New Literal rv.Text = text Return rv End Function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)