problem with bound repeater

B

Benjamin Bittner

Hi NG,
my problem is pretty simple i think. ive got a repeater with a textbox and a
button. after submitting the page with the button, i want to get the
textbox.text value. but i dont seem to find a way. here is what ive tried so
far:

Dim dbDatum As String = CType(FindControl(txtDatumE.ClientID), TextBox).Text
Dim dbDatum As String = CType(Page.FindControl(txtDatumE.ClientID),
TextBox).Text
Dim dbDatum As String = CType(FindControl("txtDatumE"), TextBox).Text
Dim dbDatum As String = CType(rpEdit.FindControl("txtDatumE"), TextBox).Text

txtDatumE is the textbox, and rpEdit is the repeater.
the textbox is nested in the repeater like this:

<asp:Repeater ID="rpEdit" Runat="server">
<ItemTemplate>
<asp:TextBox ID="txtDatumE" Runat="server">
</ItemTemplate>
</asp:Repeater>
so nothing special there...

thx in advance
greets benni
 
A

avnrao

use ItemCommand of Repeater and access e.Item.FindControl to find the
textbox.
Repeater1_ItemCommand(object
source,System.Web.UI.WebControls.RepeaterCommandEventArgs e)

if your button is outside of the repeater control, use e.Items to navigate
thru the items and find the textbox.

hth,
Av.
 

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

Top