Pregunta

I'm trying to add an empty asp:BulletedList to a page so I can run a jquery on it. But when I open the page the bulletlist doesn't show up.

Is there a trick to getting an empty asp:BulletedList to show up?

¿Fue útil?

Solución

Empty BulletedList like this:

<asp:BulletedList ID="BulletedList1" runat="server">
</asp:BulletedList>

will not render into page HTML at all because it makes no sense much as <UL> element without <LI> elements.

But if you add at least one (even empty) list item:

<asp:BulletedList ID="BulletedList1" runat="server">
     <asp:ListItem></asp:ListItem>
</asp:BulletedList>

It will render as

<ul id="BulletedList1">
   <li></li>
</ul>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top