gpt4 book ai didi

c# - 无法单击列表项内的标签

转载 作者:行者123 更新时间:2023-11-28 16:23:29 27 4
gpt4 key购买 nike

当单击列表项和单选按钮列表中的标签时,selectedIndexChanged 事件不起作用,即使单选按钮列表未被禁用也是如此。

这是代码:

<asp:Label ID="rank" runat="server" class="starss"> 
<asp:RadioButtonList OnSelectedIndexChanged ="SaveRating" AutoPostBack="true" CssClass="star-rating" ID="RadioButtonList1" runat="server">
<asp:ListItem id="star1" Value=1 runat="server" ><Label for="star1" title="1 stars" ><i class="active fa fa-star" aria-hidden="true"></i></Label></asp:ListItem>
<asp:ListItem id="star2" Value=2 runat="server" ><Label for="star2" title="2 stars" ><i class="active fa fa-star" aria-hidden="true"></i></Label></asp:ListItem>
<asp:ListItem id="star3" Value=3 runat="server" ><Label for="star3" title="3 stars" ><i class="active fa fa-star" aria-hidden="true"></i></Label></asp:ListItem>
<asp:ListItem id="star4" Value=4 runat="server" ><Label for="star4" title="4 stars" ><i class="active fa fa-star" aria-hidden="true"></i></Label></asp:ListItem>
<asp:ListItem id="star5" Value=5 runat="server" ><Label for="star5" title="5 stars" ><i class="active fa fa-star" aria-hidden="true"></i></Label></asp:ListItem>
</asp:RadioButtonList>
</asp:Label>

最佳答案

您实际上不需要或不想要您的自定义标签元素。来自documentation :

When the RadioButton control renders to the browser, it does so in two parts: an input element that represents the radio button, and a separate label element that represents the caption for the radio button. The combination of the two elements is wrapped in a span element.

关于c# - 无法单击列表项内的标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48105644/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com