Saturday, March 31, 2012

Text Box Values in Repeater being Added on Input

Hello,

I have an existing repeater on my web application that has descriptions, item numbers, and prices. The marketing person at my company wants me to add a field so that the sales people can enter discounted prices next to the regular prices. So I'm going to have to add a asp:textbox to the repeater.

What would be the easiest way of adding text fields in the repeater so that when there is input the values would add up in a label. I won't know how many items there will be in the repeater.

I'll probably need to write some javascript for this but I'm wondering what the best way of doing this is?

Thanks!
JamesIt might help if I knew how to check to see if a control exists or not? Anyone know?
The repeater should have a .Controls property with a .Length or .Count. (Count, I beleive).

From there, just start a standard FOR loop and check each control. The .ToString on the control indexer (myRepeater.Controls[i].ToString()) will tell you what TYPE of control it is. Only check the textbox types...

0 comments:

Post a Comment