By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,636 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,636 IT Pros & Developers. It's quick & easy.

Textbox inside a repeater. how to access datarow in post back event.

P: n/a
Dear sir,

I have a textbox inside a repeart control, autopostback set to true for that
textbox. When the value of this textbox changes, I need to access current
row and update database.

Repeater is bind to a dataset. VS.NET generate a below event on double click.
However, I did not see any way to access current row.

Public Sub TxtQuantity_TextChanged(ByVal sender As Object, ByVal e As System.
EventArgs)

response.write("it is here")

End Sub

How can access the datarow on repeater for that event???

regards,

Guoqi Zheng
http://www.ureader.com
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

that data row item (DataRowView in this case) exists only when dataBind is
called (on the same request after you call dataBind for the control) and due
to performance reasons it doesn't exist at postback (the repeater row
controls are recreated on postback and viewstate restored to them)

You could store IDs of the row into the repeater's row (item) with TextBoxes
or literal controls having Visible="False" so that they'd be carried with
the ViewState. When you need the keys, locate the controls in the same row
(you can access the RepeaterItem via TextBox's NamingContainer property) and
read the keys from them.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
"guoqi zheng" <no@sorry.com> wrote in message
news:2b******************************@ureader.com. ..
Dear sir,

I have a textbox inside a repeart control, autopostback set to true for
that
textbox. When the value of this textbox changes, I need to access current
row and update database.

Repeater is bind to a dataset. VS.NET generate a below event on double
click.
However, I did not see any way to access current row.

Public Sub TxtQuantity_TextChanged(ByVal sender As Object, ByVal e As
System.
EventArgs)

response.write("it is here")

End Sub

How can access the datarow on repeater for that event???

regards,

Guoqi Zheng
http://www.ureader.com

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.