M
msnews.microsoft.com
I want to read information out of a database at runtime (names of files available to download) and create a list of linkbuttons that the user can click on to download the file(s).
How can I accomplish this.
I've got this far:
In the html:
....
table>
<asp:Repeater ID="softwareList" Runat="server">
<ItemTemplate>
<tr>
<td>
<asp:LinkButton Runat="server">
<%# DataBinder.Eval(Container.DataItem,"SoftwarePath") %>
</asp:LinkButton>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
In the codebehind page:
private void Page_Load(object sender, System.EventArgs e)
{
if ( !Page.IsPostBack )
{
sqlDataAdapter1.Fill(dataSet11);
softwareList.DataSource = dataSet11;
softwareList.DataBind();
}
}
This reads the information out of the database and displays the items as links, but how do I "bind" the links to be able to download the file.
For example,
say my list looks like:
your_software_one.exe
more_software.exe
what more do I need to do to create the "click" event for each of these links to pass the filepath information to the download routine?
How can I accomplish this.
I've got this far:
In the html:
....
table>
<asp:Repeater ID="softwareList" Runat="server">
<ItemTemplate>
<tr>
<td>
<asp:LinkButton Runat="server">
<%# DataBinder.Eval(Container.DataItem,"SoftwarePath") %>
</asp:LinkButton>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
In the codebehind page:
private void Page_Load(object sender, System.EventArgs e)
{
if ( !Page.IsPostBack )
{
sqlDataAdapter1.Fill(dataSet11);
softwareList.DataSource = dataSet11;
softwareList.DataBind();
}
}
This reads the information out of the database and displays the items as links, but how do I "bind" the links to be able to download the file.
For example,
say my list looks like:
your_software_one.exe
more_software.exe
what more do I need to do to create the "click" event for each of these links to pass the filepath information to the download routine?