Link to home
Start Free TrialLog in
Avatar of TonyReba
TonyRebaFlag for United States of America

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

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of omnimaven
omnimaven

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
oops...Omni is right...its actually the e.item that is the object
Avatar of omnimaven
omnimaven

I think you need to change the ["ID"] to ("ID"). I am used to C#.
Avatar of TonyReba

ASKER

I get the following errors, where should I place this code ? , right now is on
  Protected Sub ListView1_ItemDataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.ItemDataBound

Errors:
item' is not a member of 'System.EventArgs'.
I
["ID"]
dentifier expected.            
OK this worked changing the Sub Declaration to

Protected Sub ListView1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ListViewItemEventArgs) Handles ListView1.ItemDataBound
ty