TonyReba
asked on
dynamic binding listview asp.net 3.5
How Can I bind the ID column of my Access Datasource into this code, this as is is static but I need dynamic
Protected Sub ListView1_ItemDataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.ItemDataBound
Dim myButtonPrint As Button = CType(ListView1.FindControl("PrintButton"), Button)
myButtonPrint.PostBackUrl = "PrintableProviderList.aspx?Id=132"
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oops...Omni is right...its actually the e.item that is the object
I think you need to change the ["ID"] to ("ID"). I am used to C#.
ASKER
I get the following errors, where should I place this code ? , right now is on
Protected Sub ListView1_ItemDataBound(By Val sender As Object, ByVal e As System.EventArgs) Handles ListView1.ItemDataBound
Errors:
item' is not a member of 'System.EventArgs'.
I
["ID"]
dentifier expected.
Protected Sub ListView1_ItemDataBound(By
Errors:
item' is not a member of 'System.EventArgs'.
I
["ID"]
dentifier expected.
ASKER
OK this worked changing the Sub Declaration to
Protected Sub ListView1_ItemDataBound(By Val sender As Object, ByVal e As System.Web.UI.WebControls. ListViewIt emEventArg s) Handles ListView1.ItemDataBound
Protected Sub ListView1_ItemDataBound(By
ASKER
ty