linked Button

A

Agnes

I create a table on the asp.net (web page)
there are two column , Invoice Number and download link button.
When the user click the button, the correponsed pdf will be shown.
How can I do that ??
Thanks a lot
Do While drRv.Read
Dim r As New TableRow()
Dim i As Integer
Dim c As New TableCell()
c.Controls.Add(New LiteralControl(drRv.Item("number")))
r.Cells.Add(c)
c = New TableCell()
Dim btnDownload As New LinkButton <-- ???
btnDownload.Text = "DownLoad"
btnDownload.Site = "/wto_web_doc/" + drRv.Item("hawbno") +
".pdf"
c.Controls.Add(btnDownload)
r.Cells.Add(c)
'Next i
Me.tbInvoice.Rows.Add(r)
Loop

End Sub
End Class
 
R

Robert Haken [MVP]

Well, the easier way would be to use Repeater, GridView or other data-bound
control.
If you want to generate the whole table manually, as you do, use the
HyperLink control instead of LinkButton.

MyHyperLink.Text = ...
MyHyperLink.NavigateUrl = ...

Robert Haken [MVP ASP/ASP.NET]
HAVIT, s.r.o., www.havit.cz
http://knowledge-base.havit.cz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top