List in Asp.Net

S

shapper

Hello,

I need to create the following code in ASP.NET:

<ol>
<li>
<label for="name" class="required">Name:</label>
<input name="name" id="name" size="30" value="" type="text">
</li>
<li>
...
</li>
</ol>

Is this possible using ASP.NET server controls?

Thank you,
Miguel
 
M

Michael Nemtsev

Hello Shapper,

The html <li> control which wraps the <asp:label> and <asp:TextBox> ?!

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

S> <ol>
S> <li>
S> <label for="name" class="required">Name:</label>
S> <input name="name" id="name" size="30" value="" type="text">
S> </li>
S> <li>
S> ...
S> </li>
S> </ol>
 
S

shapper

Hello Shapper,

The html <li> control which wraps the <asp:label> and <asp:TextBox> ?!

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog:http://spaces.live.com/laflour
Team blog:http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

S> <ol>
S> <li>
S> <label for="name" class="required">Name:</label>
S> <input name="name" id="name" size="30" value="" type="text">
S> </li>
S> <li>
S> ...
S> </li>
S> </ol>

Yes, and the ol to.
Is there a control there creates such a list and then I add text box
and labels to list items?

Or must I use Literal to add the code to my page?
Or maybe I should use HtmlTextWriter? How should I use it?

Thanks,
Miguel
 
M

Michael Nemtsev

Hello Shapper,

there is only BulletedList and no NumericList, afaik.

Use repeater for this - just create a collection (ArrayList for example)
which will contain the desired elements and then databind the repeater to
the collection

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

S> Yes, and the ol to.
S> Is there a control there creates such a list and then I add text box
S> and labels to list items?
S> Or must I use Literal to add the code to my page?
S> Or maybe I should use HtmlTextWriter? How should I use it?
S> Thanks,
S> Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top