简体   繁体   English

asp.net项目符号列表控件-如何隐藏项目符号点?

[英]asp.net bulleted list control - how to hide bullet points?

I've searched Google and cannot find anyway to remove the bullet points from the bulleted list control. 我已经搜索过Google,但仍然无法从项目符号列表控件中删除项目符号。 I only want a list with the text only no numbers, bullet points or letters. 我只想要一个列表,其文本仅包含数字,项目符号或字母。 How can I do this? 我怎样才能做到这一点?

If i cant do this is there an alternative to this perhaps another control i should look into? 如果我做不到,是否可以选择其他替代方法? I need to be able to get the values so I'm binding data to this control. 我需要能够获取值,以便将数据绑定到此控件。

Heres the html just in case- 这是HTML,以防万一-

<ItemTemplate>                                                                                                
   <asp:Table ID="comparator_tbl" runat="server" CssClass="plainTable">
        <asp:TableRow>
            <asp:TableCell ID="demographic_cell" runat="server" HorizontalAlign="Right">
                <asp:BulletedList ID="demographicComparator_lst" runat="server">
                </asp:BulletedList>
            </asp:TableCell>
            <asp:TableCell ID="detail_cell" runat="server" HorizontalAlign="left">
                <asp:BulletedList ID="comparator_lst" runat="server">
                </asp:BulletedList>
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
</ItemTemplate>

Bullet list control is used to show items as a bulleted list. 项目符号列表控件用于将项目显示为项目符号列表。 if you don't need bullets the you should use simple list control... I think you will have to resort to setting this with CSS since the BulletStyle property of the BulletedList doesn't support a blank style. 如果不需要子弹,则应使用简单的列表控件...我认为您将不得不使用CSS进行设置,因为BulletedList的BulletStyle属性不支持空白样式。

<asp:BulletedList ID="BulletedList1" runat="server" style="list-style-type:none;" >
</asp:BulletedList>

Hope this helps. 希望这可以帮助。

You can't remove in asp.net. 您无法在asp.net中删除。 You need to specify CssClass property for it with some style class and it should have following styles: 您需要使用一些样式类为其指定CssClass属性,并且它应具有以下样式:

.bullet-list { list-style: none; padding: 0; margin: 0;}

使用CSS确实很容易做到:

#ID-Of-Your-List ul { list-style-type: none; }

The bulleted list is finally rendered as <UL><LI>...</LI>...</UL> in the browser and you can use CSS to handle this. 项目符号列表最终在浏览器中显示为<UL><LI>...</LI>...</UL> ,您可以使用CSS进行处理。

You can set the nonbulleted style to the list like this: 您可以像这样将非项目样式设置为列表:

If the id of the list is #BulletLessList set the CSS entry as 如果列表的ID为#BulletLessList则将CSS条目设置为

#BulletLessList ul { list-style-type: none; }

If you wish to set the same style in multiple lists, you can set the css class to all the lists and set the css as 如果要在多个列表中设置相同的样式,可以将css类设置为所有列表,并将css设置为

.BulletLessList ul { list-style-type: none; }

Bullet list control is used to show items as a bulleted list. 项目符号列表控件用于将项目显示为项目符号列表。 if you don't need bullets the you should use simple list control... I think you will have to resort to setting this with CSS since the BulletStyle property of the BulletedList doesn't support a blank style. 如果不需要子弹,则应使用简单的列表控件...我认为您将不得不使用CSS进行设置,因为BulletedList的BulletStyle属性不支持空白样式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM