Small problem with repeater

  • Thread starter Thread starter Simon Harvey
  • Start date Start date
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
 
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.
 
Back
Top