By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,314 Members | 1,751 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,314 IT Pros & Developers. It's quick & easy.

Small problem with repeater

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.
"Simon Harvey" <si**********@the-web-works.co.uk> wrote in message
news:Ox**************@TK2MSFTNGP11.phx.gbl...
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

Nov 18 '05 #2

P: n/a
Thanks avnrao

Simon
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.