2

基本上,我只想要 RadioButtonList 上面没有单选按钮,我将对 rbl 进行编码,以便所选项目具有不同的背景颜色并使其看起来更专业,单选按钮本身我希望能够摆脱术语外观...如果您知道任何方法,请告诉我!

4

3 回答 3

2

这对我帮助很大:http_://www.ryanfait.com/resources/custom-checkboxes-and-radio-buttons/

这个链接坏了,原主是..永远离线,所以内容

也许对于任何阅读本文的人来说,可以尝试在 css 的输入中将背景设置为无

<style>
   input {
      background:none !important;
   }
</style>
于 2010-01-08T19:14:54.107 回答
1

如果不将一些技巧与 javascript 混合,我想不出任何简单的方法。

这可能是您想要的东西:
可访问的、自定义设计的复选框和单选按钮输入样式与 CSS(和一些 jQuery)

这里的独立演示

用于模仿单选按钮的图像:(来源:filamentgroup.com单选按钮图像

于 2010-01-08T19:03:04.520 回答
0

找到了一个合理的解决方案...

    <head runat="server">
    <title>Test - Hide radio circles from radiobuttonlist</title>
    <script type="text/javascript">
    function hideRadioSymbol()
    {
        var rads = new Array();
        rads = document.getElementsByName('list1'); //Whatever ID u have given to ur radiolist.
        for(var i = 0; i < rads.length; i++)
            document.getElementById(rads.item(i).id).style.display = 'none'; //hide
    }
    </script>
    </head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:RadioButtonList ID="list1" runat="server">
            <asp:ListItem Value="item1" Text="item1"></asp:ListItem>
            <asp:ListItem Value="item2" Text="item2"></asp:ListItem>
        </asp:RadioButtonList>
    </div>
    <script type="text/javascript">hideRadioSymbol()</script> //After list is completely rendered/loaded.
    </form>
</body>
</html>

哦,顺便说一句,mvc 太棒了,asp.net从一开始就应该是这样!

于 2010-01-10T12:10:22.177 回答