Go Back   Velocity Reviews > Newsgroups > DotNet
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

DotNet - DataList: Collecting IDs and TextBox values at same time

 
Thread Tools Search this Thread
Old 08-25-2009, 10:06 AM   #1
Default DataList: Collecting IDs and TextBox values at same time


I have a datalist with 2 columns of products with a TextBox next to each product so my customer can enter a number in each checkbox (to determine the order sequence when this list of products is printed to the screen). I have a button for my customer to click when she is happy with the sequence chosen for each product and this calls a subroutine within which I need to be able to collect each productID and the number entered into the textbox next to it. This worked perfectly in my old system using Classic ASP and can't understand why it's so difficult to offer the same funtionality in ASP.Net! I have tried various approaches but none of them work in collecting the number entered into the TextBox and the ProdId at the same time. I tried storing the ProductId in the ID of the TextBox in the hope that I could then retrieve both the ProductId and the value of the TextBox for each product when the button is clicked but values of the TextBox ID are values such as 567 or 784 and are set dynamically (these are the productIds). The error I'm getting is as follows:

The ID property of a control can only be set using the ID attribute in the tag and a simple value. Example: <asp:Button runat="server" id="Button1" />
and the line containing the error is:
<asp:TextBox runat="server" ID='<%# DataBinder.Eval(Container.DataItem, "Prod_ID")%>' Text='<%# DataBinder.Eval(Container.DataItem, "Sequence1")%>'></asp:TextBox>

Any advice would be greatly apreciated.
Thanks, Lorna


Lorna70
Lorna70 is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get datagrid textbox value kanchangorak Software 0 03-11-2009 11:11 AM
VB .NET: How to extract the value of a textbox in a GridView TemplateField? k3nz0 General Help Related Topics 1 03-01-2009 06:26 AM
gridview textbox value refresh apdbrl1 Software 1 06-12-2008 06:29 PM
ASP.NET VB Using ItemDataBound to create textbox in datagrid rows. smi59550 General Help Related Topics 0 01-18-2008 07:42 PM
How do find out if a button was clicked before the textchanged event of textbox fires Jack General Help Related Topics 0 10-27-2006 10:19 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46