C# 在Asp.net页面中不可见单选按钮
Asp.net单选按钮在我的页面中不可见。我在Asp listview中使用它。我还尝试将单选按钮放在asp.net更新面板内容模板中。请告诉我出了什么问题C# 在Asp.net页面中不可见单选按钮,c#,asp.net,user-interface,radio-button,visible,C#,Asp.net,User Interface,Radio Button,Visible,Asp.net单选按钮在我的页面中不可见。我在Asp listview中使用它。我还尝试将单选按钮放在asp.net更新面板内容模板中。请告诉我出了什么问题 <asp:ListView ID="FraudCheckList_listView" runat="server"> <ItemTemp
<asp:ListView ID="FraudCheckList_listView" runat="server">
<ItemTemplate>
<p class="fraud-step-title"><%#Eval("question")%></p>
<div class="row">
<asp:RadioButton runat="server" class="radio-inline col" GroupName="govt" Text="Low Risk"></asp:RadioButton>
<asp:RadioButton runat="server" GroupName='govt' Text="Medium Risk"></asp:RadioButton>
<asp:RadioButton runat="server" GroupName='govt' Text="High Risk"></asp:RadioButton>
</div>
</ItemTemplate>
</asp:ListView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:ListView ID="FraudCheckList_listView" runat="server">
<ItemTemplate>
<p class="fraud-step-title"><%#Eval("question")%></p>
<div class="row">
<asp:RadioButton runat="server" class="radio-inline col" GroupName="govt" Text="Low Risk"></asp:RadioButton>
<asp:RadioButton runat="server" GroupName='govt' Text="Medium Risk"></asp:RadioButton>
<asp:RadioButton runat="server" GroupName='govt' Text="High Risk"></asp:RadioButton>
</div>
</ItemTemplate>
</asp:ListView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:ListView ID="FraudCheckList_listView" runat="server">
<ItemTemplate>
<p class="fraud-step-title"><%#Eval("question")%></p>
<div class="row">
<asp:RadioButton runat="server" class="radio-inline col" GroupName="govt" Text="Low Risk"></asp:RadioButton>
<asp:RadioButton runat="server" GroupName='govt' Text="Medium Risk"></asp:RadioButton>
<asp:RadioButton runat="server" GroupName='govt' Text="High Risk"></asp:RadioButton>
</div>
</ItemTemplate>
</asp:ListView>
</ContentTemplate>
</asp:UpdatePanel>
既然你没有分享你的代码是什么样子,我只是假设一些事情。看看你有没有这样做
<asp:ListView ID="FraudCheckList_listView" runat="server">
<ItemTemplate>
<p class="fraud-step-title"><%#Eval("question")%></p>
<div class="row">
<asp:RadioButton runat="server" class="radio-inline col" GroupName="govt" Text="Low Risk"></asp:RadioButton>
<asp:RadioButton runat="server" GroupName='govt' Text="Medium Risk"></asp:RadioButton>
<asp:RadioButton runat="server" GroupName='govt' Text="High Risk"></asp:RadioButton>
</div>
</ItemTemplate>
</asp:ListView>
</ContentTemplate>
</asp:UpdatePanel>
无效按钮\单击(对象发送者,System.EventArgs e){RadioButton.Visible=false;}
<asp:ListView ID="FraudCheckList_listView" runat="server">
<ItemTemplate>
<p class="fraud-step-title"><%#Eval("question")%></p>
<div class="row">
<asp:RadioButton runat="server" class="radio-inline col" GroupName="govt" Text="Low Risk"></asp:RadioButton>
<asp:RadioButton runat="server" GroupName='govt' Text="Medium Risk"></asp:RadioButton>
<asp:RadioButton runat="server" GroupName='govt' Text="High Risk"></asp:RadioButton>
</div>
</ItemTemplate>
</asp:ListView>
</ContentTemplate>
</asp:UpdatePanel>
如果这是真的或者你的单选按钮不可见。在你的情况下,它必须隐藏起来。所以你可以把你的代码改成这个,然后试试看。
这需要在主代码中完成。不是在你的html代码中。
谢谢大家! 你需要分享你的代码。如果没有这些,我们就无法猜出哪里出了问题以及如何更正。谢谢@ChetanRanpariya我已经上传了代码,但似乎没有css问题。您是否可以将任何数据加载到listview?是的。我正在从表数据源加载数据。您能分享ListView的屏幕截图吗?在Page_Load方法中,我使用了RadioButton radio=new RadioButton();可见=假;但这没什么区别。哦,对不起。我的错。试试收音机。可见=真;这行吗?你能不能更新你的问题,同时显示你的html代码?html页面包含大约5000行代码,Aadi。我会尝试给你相关的代码。好的。否则只需更新您的问题,显示针对单选按钮编写的代码。这也可以奏效
<asp:ListView ID="FraudCheckList_listView" runat="server">
<ItemTemplate>
<p class="fraud-step-title"><%#Eval("question")%></p>
<div class="row">
<asp:RadioButton runat="server" class="radio-inline col" GroupName="govt" Text="Low Risk"></asp:RadioButton>
<asp:RadioButton runat="server" GroupName='govt' Text="Medium Risk"></asp:RadioButton>
<asp:RadioButton runat="server" GroupName='govt' Text="High Risk"></asp:RadioButton>
</div>
</ItemTemplate>
</asp:ListView>
</ContentTemplate>
</asp:UpdatePanel>