问题标签 [radiobuttonlist]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
2413 浏览

c# - 将 GroupName 添加到 RadioButtonList 中的项目

我创建了一个继承自 RadioButtonList 的类,以便为每个列表项添加一个 GroupName 属性。(为什么它不在那里我不知道)。

这在呈现时按预期工作,但不会在回发时保留所选项目。

有谁知道我错过了什么?

谢谢。

0 投票
1 回答
1840 浏览

asp.net - 使用jQuery按钮集时在代码后面获取asp.net radiobuttonlist选择的值

我在 ASP.NET 单选按钮列表上使用 jQueryUI 按钮集。当页面回发时,我需要在服务器端代码中获取选定的值。如果我不应用 jQuery 按钮集,这当然很容易——只需抓住“SelectedValue”。但是,当我应用 jQuery 按钮集时,所选值在回发时似乎不再可用。有什么办法可以解决这个问题,还是我需要在客户端获取选定的值,然后自己将其传回?

0 投票
1 回答
23984 浏览

asp.net - 将单选按钮列表绑定到gridview中的列

我在需要绑定到列的网格视图中有单选按钮列表。如果一列中的值为 0,则选择第一个单选按钮,如果为 1,则选择另一个。

这是代码,其中一些被部分删除,因为它不是必需的

代码隐藏:

0 投票
2 回答
16529 浏览

c# - 动态填充 RadiobuttonList

我的 ASP.net 网络表单中有很多单选按钮列表。我使用如下所示的方法动态绑定它们:

现在,我只想显示 RadioButton 项文本的 DataTextField 的第一个字母。

例如,如果值很好,我只想显示 G。如果它公平,我想显示 F。

我如何在 C# 中执行此操作

谢谢

0 投票
1 回答
685 浏览

android - 使用来自 squlite 数据库的数据填充单选按钮组

我正在为 Android 编写一个游戏应用程序,其中一个带有四种不同选项的问题词将显示用户可以在其中进行选择。

我有一个数据库,我可以从应用程序插入,但是使用 select 语句,然后解析响应并填充无线电组中的五个不同位置的最简单方法是什么?

我已经完成了开发人员的记事本教程。网站,对于我需要的东西来说似乎有点太复杂了。至少我不能很好地破译它以应用于我的项目。

谢谢你的帮助!/AK

0 投票
1 回答
3538 浏览

javascript - 使用 JavaScript 评估 RadioButtonList 控件 - ASP.Net

我正在使用 asp.net 和 C# 开发一个网站。

我正在使用 RadioButtonList 控件。RadioButtonList 的代码片段如下所示

在同一页面中有一个按钮。单击该按钮时,我想使用 javascript 显示基于所选单选列表项的警报消息。我的javascript函数的某些部分如下所示

但是 if(RLCompareParameter.SelectedValue == "some value") 总是假的。我认为 RadioButtonList 控件没有像选定值这样的属性。我希望有人帮助我

0 投票
2 回答
459 浏览

asp.net - 水平渲染单选按钮列表

单选按钮列表可以呈现如下

其中r表示单选按钮列表中的单选按钮,其上方的文本是单选按钮文本的一部分。

0 投票
1 回答
896 浏览

asp.net - Timer in UPdatePanel changes selectedIndex of RadioButtonList

I have a situation where I have a page in ASP.NET. In this page I have a RadioButtonList, which contains 5 solutions to a question. The RadioButtonList is feeded by an object, which has these solutions.

I have a timer, which runs every second, to update loads of graphical controls. Everything works, BESIDES the RadioButtonList selection.

This is what happends:

When I select an item in the RadioButtonList and the timer tick, the selectedIndex of the RadioButtonLIst value is 0.

This means it selects the FIRST item in the list. However, IF I click an item, which has a "Yes" value in it (the value field can either have "No" or "Yes", it will stay at this item.

First of all, I have NO idea why the timer re-select my RadioButtonList selection, as any other Page_Load event does nothing. And even if that makes sense, I have no idea why it just re-selects SOME of the answers..

I have the following HTML code:

I have the following code behind:

So, to summarize, my problem is...

When the timer ticks, the RadioButtonList re-select item 0. This is however not consistent, and sometimes it doesn't re-select. I'd rather it didn't re-select at all! :)

0 投票
1 回答
2646 浏览

asp.net - 如何将 RadioButtonList 转换为 JQuery UI 按钮列表?

我的表单上有一个 ASP.NET RadioButtonList,我想将它转换为这样的 JQuery Button

我的简单代码:

单击 btnInsert 按钮时,我想检索所选单选按钮的值,但使用 JQuery 按钮。

我该怎么做呢?

0 投票
2 回答
1649 浏览

asp.net - 在 asp.net 中检查 RadioButtonList 和 TextBox 值的 CustomValidator 遇到问题

我有一个表单,其中包含一个名为“wmi_cell_phone”的文本框和一个 RadioButtonList“wmi_send_sms”。基本上,我需要创建一个验证器来检查所选单选的值是否为“Y”。如果是这种情况,那么它会检查 TextBox 值是否为空。如果它是空的,那么它应该通知用户输入一个值。

这是我的 .aspx 代码:

和代码隐藏(VB):

我的验证器

但它似乎不起作用..也许我以错误的方式访问 RadioButtonList..