Tuesday, March 27, 2012

List in Asp.Net

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,
MiguelHello Shapper,

The html <licontrol which wraps the <asp:labeland <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>
On May 25, 10:08 pm, Michael Nemtsev <nemt...@.msn.comwrote:

Quote:

Originally Posted by

Hello Shapper,
>
The html <licontrol which wraps the <asp:labeland <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
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

SOn May 25, 10:08 pm, Michael Nemtsev <nemt...@.msn.comwrote:
S>

Quote:

Originally Posted by

Quote:

Originally Posted by

>Hello Shapper,
>>
>The html <licontrol which wraps the <asp:labeland <asp:TextBox>
>?!
>>
>--
>>
>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>


SYes, and the ol to.
SIs there a control there creates such a list and then I add text box
Sand labels to list items?
SOr must I use Literal to add the code to my page?
SOr maybe I should use HtmlTextWriter? How should I use it?
SThanks,
SMiguel

0 comments:

Post a Comment