Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

datalist

SarahLeeSarahLee Member Posts: 3

hi all

i have a datalist, in which i am displaying a single record at a time
like

ProductID: xx ....> these values are bounded to a label control.
ProductName: xxxx
UnitPrice: xxxx

now when i click a button, say button i , which is outside datalist, i want the values xx, xxx, xxxx
to be assigned to
item.productid
item.productname
item.unitprice

i dont know how can i get the values in a datalist,
but i tried with the below code, but its showing error

item.productid = Integer.Parse(DataList1.Items.Item(1).ToString())
item.ProductName = DataList1.Items.Item(2).ToString
item.UnitPrice = Decimal.Parse(DataList1.Items.Item(3).ToString())

can anyone please help me
thanks in advance

Sign In or Register to comment.