Small problem with repeater

S

Simon Harvey

Hi all

I'm hoping someone can help me with the following problem.

I have a repeater control that needs to display a textbox in a couple of the
columns. The problem is I don't know how I can uniquely identify each
textbox when it comes to doing the processing once the confirm button is
pressed at the bottom of the page.

I thought I might be able to do something like:

<td><asp:TextBox id="txt<%# DataBinder.Eval(Container.DataItem, 'testName')
%>" runat="server" BorderStyle="Solid" BorderWidth="1px"></asp:TextBox></td>


Notice how I'm trying to name the text box according to some info in the
database - in this case the name of a medical test.

This doesn twork unfortunately. It tells me that this is an invalid
identifier which isnt entirely unreasonable!

Does anyone have any ideas on how I can identify each of the text boxes when
it comes to processing time?

Thanks to anyone who can help with this

Simon
 
A

avnrao

instead of naming the text boxes uniquely, let asp.net name them uniquely.
you can still access text based on the row.
using Repeater.Item.FindControl("yourtextboxname");

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

Similar Threads

repeater 0
Repeater question 4
Repeater Problem 1
Repeater control 1
Asp.Net repeater 4
repeater 3
Repeater problem ... 4
underlining a row in a repeater control 2

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top