0

基本上我有下面的代码,每次页面刷新时,按钮集都会恢复到看起来像单选按钮。难道我做错了什么?

<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
    $( ".filter_type" ).buttonset();
});
</script>

<asp:RadioButtonList ID="rbtnTimeRange" class="filter_type" name="filter_type"   RepeatDirection="Horizontal" 
                AutoPostBack="true" runat="server"  OnSelectedIndexChanged="TimeRange" >
            <asp:ListItem Value="1" Selected="True">Today</asp:ListItem>
            <asp:ListItem Value="5">MTD</asp:ListItem>
        </asp:RadioButtonList>
4

1 回答 1

0

修改你的asp代码如下(注意标签style="display:none"

<asp:RadioButtonList ID="rbtnTimeRange" class="filter_type" Style="display:none" name="filter_type"   RepeatDirection="Horizontal" AutoPostBack="true" runat="server"  OnSelectedIndexChanged="TimeRange" >
    <asp:ListItem Value="1" Selected="True">Today</asp:ListItem>
    <asp:ListItem Value="5">MTD</asp:ListItem>
</asp:RadioButtonList>

然后$( ".filter_type" ).show();在jQuery中使用如下

<script>
$(function() {
    $( ".filter_type" ).buttonset();
    $( ".filter_type" ).show();
});
</script>
于 2013-01-03T21:13:57.797 回答