473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Draw html with loop?

Rob
I am new to ASP.NET and am trying to convert an old ASP project to a C# web
application. I have a page with a very long form on. On part of the form
has a series of comboboxes that a populated with data from a database. In
my old ASP project I wrote the HTML doing something like this

<% for i = 1 to 10 %>
<tr>
<td><select name='test'><option value='<%= i %></option><.select></td>
</tr>
<%next%>

This is not the exact code an is abbreviated just for this post. How do I
do something similar in .NET? Also, is there a way of doing this with a set
of radio buttons with having to use the radiobuttonlist control? I think
the design options are a little limited for this control.

Thanks.

Rob
Nov 18 '05 #1
2 1212
You can do exactly the same thing if you are using inline code. That would
be the easy way for a quick conversion. Or call a function inline, and have
the Response.Write() calls in the function.

Otherwise, use one of the bindable controls (repeater, datalist, etc), and
either add rows to the datalist in a loop or make a collection or array and
bind to the list.

Jeffrey Palermo

"Rob" <ro*@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am new to ASP.NET and am trying to convert an old ASP project to a C# web application. I have a page with a very long form on. On part of the form
has a series of comboboxes that a populated with data from a database. In
my old ASP project I wrote the HTML doing something like this

<% for i = 1 to 10 %>
<tr>
<td><select name='test'><option value='<%= i %></option><.select></td>
</tr>
<%next%>

This is not the exact code an is abbreviated just for this post. How do I
do something similar in .NET? Also, is there a way of doing this with a set of radio buttons with having to use the radiobuttonlist control? I think
the design options are a little limited for this control.

Thanks.

Rob

Nov 18 '05 #2
Use a DataList, DataTable or DataRepeater Control.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Rob" <ro*@nospam.com> wrote in message
news:#e**************@tk2msftngp13.phx.gbl...
I am new to ASP.NET and am trying to convert an old ASP project to a C# web application. I have a page with a very long form on. On part of the form
has a series of comboboxes that a populated with data from a database. In
my old ASP project I wrote the HTML doing something like this

<% for i = 1 to 10 %>
<tr>
<td><select name='test'><option value='<%= i %></option><.select></td>
</tr>
<%next%>

This is not the exact code an is abbreviated just for this post. How do I
do something similar in .NET? Also, is there a way of doing this with a set of radio buttons with having to use the radiobuttonlist control? I think
the design options are a little limited for this control.

Thanks.

Rob

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: noise | last post by:
Hello, I have problem with drawing running graph. What I want to draw is: I have an object O which as a real number r associated with it. In the main() (in main class) i have a for loop which do...
0
by: Florida Draw | last post by:
------=_NextPart_000_0012_1D5428A2.65C196F8 Content-Type: text/plain Content-Transfer-Encoding: 8bit Sign-up for the FREE Holiday Giveaway Draw You must register to be eligible for the draw....
3
by: John | last post by:
How can I draw any thing within "for" loop? I tried the below but it doesn't draw anything. What should I do? **** Code **** Graphics g = this.CreateGraphics(); Bitmap bm=new Bitmap(1,1);...
0
by: CyanSky | last post by:
Hello, i have a thread running with a loop of methods, they are drawing to the GDI (not GDI+). But there are no results on screen. It is like i would draw into a null-device. I've tested...
6
by: redneon | last post by:
Is it possible to draw directly to the screen using the .net libraries? I thought that it might be possible with GDI+ but I can't find out how to do it anywhere. A part of me suspects I may have to...
1
by: Praveen | last post by:
Hello, I have a web page which will display the map of a city/place. I have a toolbar which contains 'zoom in' and 'zoom out' buttons. When the user clicks on zoom in/zoom out button, he should...
0
by: news | last post by:
If anyone can recommend a more appropriate newsgroup for this question? We recently upgraded from php 4.1.2 to php 4.3.9 and ImageMagick 5.5.7 to version 6.2.5. I have a script that creates a...
1
by: Alejandro | last post by:
Hi, I Have a form with Collection of 52 picturebox. Public cl As New Collection Private m_Bitmap As Bitmap Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)...
1
by: Daniel Mark | last post by:
Hello all: I am using PIL to draw a rectangle filled with color blue. Is there anyway I could set the fill pattern so that the drawn rectangle could be filled with gradient blue? Thank...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.