Getting the DataSource from a Repeater

F

Fred Dag

Hi,
I have a Repeater that is filled with a PagedDataSource and upon receiving a
OnTextChanged event from an <ItemTemplate> Textbox I attempt need to get
details from the row in the DataSet such as its row ID. When I try to do
this I get a NullReference Exception.

Code looks like this:
Repeater repeaterCI = (Repeater)((Control)sender).NamingContainer.Parent;

Response.Write("(DataSet)repeaterCI.DataSource" +
repeaterCI.DataSource.ToString() );



Which causes a NullReference Eception even though repeaterCI.ToString() =
System.Web.UI.WebControls.Repeater & the items on the page have many rows of
info.

How do I solve this problem?



Thanks in advance
 

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

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,217
Latest member
IRMNikole

Latest Threads

Top