Wrox Programmer Forums
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 14th, 2006, 12:04 PM
Registered User
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default creating dynamic textboxes

I am trying to create a maths test where questions are accessed from a database and displayed on a web page with testboxes for each question. I have got the test 'looking' the right way with the following code:

<td valign="top">
    <asp:Repeater id="rpcEmpDirectory" runat="server">
    <p><strong>Question <%# DataBinder.Eval(Container.DataItem, "QuestionNumber") %></strong></p>
    <p><%# DataBinder.Eval(Container.DataItem, "Question") %></p>
    <p><strong>Answer: <asp:TextBox id="answer" runat="server" TextMode="Answer" /></p>
    <p><asp:Button id="btnSubmit" runat="server" Text="Submit Test" OnClick="SubmitTest" /></p>

However, the textboxes will not function properly as they all have the same ID. I guess there must be some code behind to generate them, how would I do this in c#?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get all user data from ALL dynamic textboxes feffe VB How-To 3 May 31st, 2007 07:03 AM
About dynamic textboxes data capturing chandra_yvr ASP.NET 2.0 Basics 5 March 30th, 2007 09:58 AM
Creating Textboxes jfleming VB How-To 7 July 14th, 2004 11:35 PM
Creating Dynamic Images mvollmer Classic ASP Basics 0 March 4th, 2004 01:31 PM
creating dynamic list fyeojo VS.NET 2002/2003 4 September 2nd, 2003 03:13 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.