Normally I would set <%# DataBinder.Eval(Container, "DataItem.Name") %>
while filling a dataset with adapter or with a reader and assigning values
to <%# DataBinder.Eval(Container, "DataItem.Name") %> as each row is read
and rendered. The data grid is confusing me . I never used one before until
now.
so somewhere in here:
articleList.DataSource = dirInfo.GetFiles("*.*")
'Before I bind somehow I need to make the url = the domain that I am working
with. So that is where I am confused. I also was trying to figure out how I
could just use a datareader and output the files that way with a
stringbuilder and making custom html list. I know it is probably easy to use
a datagrid but coming from asp classic it feels like osme things are just
more difficult in .net. I mean in asp classic making a list of files and
modifying alink on output was easy. I search google but find the same info
everywhere and it is usually working with a database and not file directory
contents.....
articleList.DataBind()
I have this in the code behind:
If Not IsPostBack Then
'PanelUser.Visible = False
'PanelAdmin.Visible = False
'PanelNoAccess.Visible = True
Dim strFtpFolder
strFtpFolder = Session("FtpFolder")
Dim dirInfo As New DirectoryInfo(strFtpFolder)
'Dim dirInfo As New DirectoryInfo(Server.MapPath(""))
'articleList.DataSource = dirInfo.GetFiles("*.aspx")
articleList.DataSource = dirInfo.GetFiles("*.*")
articleList.DataBind()
End If 'If Not IsPostBack Then
IN ASPX PAGE SOURCE:
'''''''''''''''
<FORM id="Form1" runat="server">
<asp:label id="lblMessage" runat="server" ForeColor="Red"
Font-Italic="True"></asp:label>
<asp
ataGrid id="articleList" runat="server" Font-Size="Smaller"
OnDeleteCommand="articleList_DeleteFile"
OnItemDataBound="articleList_ItemDataBound" DataKeyField="FullName"
HeaderStyle-Font-Bold="True"
HeaderStyle-Font-Size="15pt" HeaderStyle-ForeColor="White"
HeaderStyle-BackColor="Navy" AlternatingItemStyle-BackColor="#eeeeee"
AutoGenerateColumns="False" Font-Name="Verdana" Font-Names="Verdana"
Width="615px">
<FooterStyle Font-Size="Smaller"></FooterStyle>
<AlternatingItemStyle BackColor="#EEEEEE"></AlternatingItemStyle>
<HeaderStyle Font-Size="Larger" Font-Bold="True" ForeColor="White"
BackColor="Navy"></HeaderStyle>
<Columns>
<asp:ButtonColumn Text="Delete" ButtonType="PushButton"
CommandName="Delete"></asp:ButtonColumn>
<asp:TemplateColumn HeaderText="File Name">
<ItemTemplate>
<asp:HyperLink runat=&quo