Can you use DataSource property from event handler?

  • Thread starter Thread starter Fred Dag
  • Start date Start date
F

Fred Dag

Hi,
I am trying to get the DataSet from a Repeater using its DataSource property
from an event handler.

I am getting Null instead.

Should the DataSource persist when the event hadler is called or is Null the
expected result?

Still trying to understand the event model.

Thanks in advance.
 
Nope. Values withint the repeater will persist, but only as attributes of
the repeater.

so if you do:

<ItemTemplate>
<asp:literal id="firstName" runat="server"><%#
DataBinder.Eval(Container.DataItem, "FirstName") %></asp:Literal>
</ItemTemplate>

you'll be able to loop through the items of the repeater, retreive the
firstName literal and get it's value.

Otherwise you'll need to persist the data source yourself.

Karl
 

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

Back
Top