Programming2007
Programmer
I am using a DataList to display a list of hyperlinks and labels. A user enters a search criteria and the page (hyperlink) is displayed along with a sentence (label)where the keyword is used. I have a Files arraylist of hyperlinks and a Descriptions arrayList of sentences. I don't know how to get this to work.
Here is my webForm1.aspx
<asp:datalist id="DataList1" runat="server">
<ItemTemplate>
<asp:HyperLink id=hypLocation runat="server" NavigateUrl="<%# Container.DataItem %>" text="<%# Container.DataItem %>">
</asp:HyperLink>
<asp:Label id=lblDescription runat="server" Visible="true" text="<%# Container.DataItem %>">
</asp:Label>
</ItemTemplate>
</asp:datalist>
Here is my WebForm1.vb
Descriptions.Add(strDescription)
DataList1.DataSource = Descriptions
DataList1.DataBind()
allFiles(inttemp) = (allFiles(inttemp).Replace("C:\SCoutline4", "allFiles(inttemp) = allFiles(inttemp).Replace("\", "/")
Files.Add(allFiles(inttemp))
DataList1.DataSource = Files
DataList1.DataBind()
I also tried the following and it didn't work
<asp:datalist id="DataList1" runat="server">
<ItemTemplate>
<asp:HyperLink id=hypLocation runat="server" NavigateUrl="<%#DataBinder.Eval(Container.DataItem,"Files") %>" text="<%#DataBinder.Eval(Container.DataItem,"Files") %>">
</asp:HyperLink>
<asp:Label id=lblDescription runat="server" Visible="true" text="<%#DataBinder.Eval(Container.DataItem,"Descriptions") %>">
</asp:Label>
</ItemTemplate>
</asp:datalist>
Here is my WebForm1.vb
Function getWebViewFiles(ByVal s As String()) As ICollection
Descriptions.Add(strDescription)
allFiles(inttemp) = (allFiles(inttemp).Replace("C:\SCoutline4", "allFiles(inttemp) = allFiles(inttemp).Replace("\", "/")
Files.Add(allFiles(inttemp))
DataList1.DataSource = getWebViewFiles(allFiles)
DataList1.DataBind()
Here is my webForm1.aspx
<asp:datalist id="DataList1" runat="server">
<ItemTemplate>
<asp:HyperLink id=hypLocation runat="server" NavigateUrl="<%# Container.DataItem %>" text="<%# Container.DataItem %>">
</asp:HyperLink>
<asp:Label id=lblDescription runat="server" Visible="true" text="<%# Container.DataItem %>">
</asp:Label>
</ItemTemplate>
</asp:datalist>
Here is my WebForm1.vb
Descriptions.Add(strDescription)
DataList1.DataSource = Descriptions
DataList1.DataBind()
allFiles(inttemp) = (allFiles(inttemp).Replace("C:\SCoutline4", "allFiles(inttemp) = allFiles(inttemp).Replace("\", "/")
Files.Add(allFiles(inttemp))
DataList1.DataSource = Files
DataList1.DataBind()
I also tried the following and it didn't work
<asp:datalist id="DataList1" runat="server">
<ItemTemplate>
<asp:HyperLink id=hypLocation runat="server" NavigateUrl="<%#DataBinder.Eval(Container.DataItem,"Files") %>" text="<%#DataBinder.Eval(Container.DataItem,"Files") %>">
</asp:HyperLink>
<asp:Label id=lblDescription runat="server" Visible="true" text="<%#DataBinder.Eval(Container.DataItem,"Descriptions") %>">
</asp:Label>
</ItemTemplate>
</asp:datalist>
Here is my WebForm1.vb
Function getWebViewFiles(ByVal s As String()) As ICollection
Descriptions.Add(strDescription)
allFiles(inttemp) = (allFiles(inttemp).Replace("C:\SCoutline4", "allFiles(inttemp) = allFiles(inttemp).Replace("\", "/")
Files.Add(allFiles(inttemp))
DataList1.DataSource = getWebViewFiles(allFiles)
DataList1.DataBind()