- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在寻找处理在 ASP.net RadioButtonList(后面的 C# 代码)上选择的索引更改的最佳方法。我有 3 个列表项。对于第一个,我希望它在页面上显示一个隐藏的 asp:textbox,而另外两个将隐藏文本框。
//asp.net side
<asp:RadioButtonList ID="_indicatorAckType" runat="server" RepeatDirection="Horizontal"
enabled="true" OnSelectedIndexChanged="onAckTypeChanged">
<asp:ListItem Text="None" />
<asp:ListItem Text="SHOW" />
<asp:ListItem Text="HIDE" />
</asp:RadioButtonList>
//code behind
protected void onAckTypeChanged(object sender, EventArgs e)
{
if (_indicatorAckType.SelectedItem.Text == "SHOW")
_myTextboxID.Visible = true;
else
_myTextboxID.Visible = false;
}
我最初尝试使用 onclick 事件处理程序,但我被告知 ListItem 不能对单选按钮项使用 onclick 事件。我在这里做错了什么?这不会引发任何错误或有任何明显的问题。我试过让 onSelectedIndexChanged 除了显示文本框之外什么都不做,但这也不起作用。
感谢任何帮助!谢谢大家。
最佳答案
在 RadioButtonList 上,将 AutoPostBack
属性设置为 true。
关于c# - RadioButtonList OnSelectedIndexChanged,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6983821/
ASPX页面: fileupload dropdownlist subject Textarea 用户可以在textarea中写入任何内容。没有顺序,用户可以先写入文本或上传文件。Dropdownl
我正在寻找处理在 ASP.net RadioButtonList(后面的 C# 代码)上选择的索引更改的最佳方法。我有 3 个列表项。对于第一个,我希望它在页面上显示一个隐藏的 asp:textbox
我有一个按钮和一个dropdownlst 我有这个脚本: $("form").submit(function (e) { $('#divOverlay').show();
在GridView中,为什么我必须在同一页面中定义select方法而不是C#文件? 例如,在index.aspx中,我有
Dropdownlist_OnSelectedIndexChanged 和 Checkbox_OnCheckedChanged 事件都没有在 UpdatePanel 之后从 UpdatePanel 中
我有一个这样的下拉列表 在代码隐藏中我正在这样做 page_load : if(!page.postback)I m binding data into dropdownlist fire_e
OnSelectedIndexChanged 事件没有为我的下拉框触发。我查看过的所有论坛都告诉我添加 AutoPostBack="true",但这并没有改变结果。 HTML:
我有一个带有下拉列表的页面 Cellsite Agreement Event User
我在下拉列表上应用了脚本以获得时尚的外观,并且样式应用得当, 但在 .cs 页面(代码页)中,下拉列表的 OnSelectedIndexChanged 无法正常工作。 我的 html 代码是:
我正在尝试获取 GridView 的选定行,并且我知道我应该能够根据 OnSelectedIndexChanged 事件获取该信息。每当我单击该行时,事件都不会触发。
我有一个 aspx 页面,我在其中动态添加一个带有 OnSelectedIndexChanged 事件的单选按钮列表。如果我检查所选项目。我有 2 件元素。 对于第一项,事件触发良好,但是如果我选择其
我无法触发下拉列表 onselectedindexchanged 事件,当我进行选择时,它会重置下拉列表 onpostback 的值,即使我有 if (!ispostback) 在页面加载事件中。 这
我有一个带有 linkbutton 的 ListView ,也尝试过使用 imagebutton,我想做的是 通过在 ListView 中使用 OnSelectedIndexChanged 在我的代码
是否可以在没有 AutoPostBack=True 的情况下强制下拉列表触发 OnSelectedIndexChanged 事件? 我之所以这么说,是因为我的表单中有一些 RadComboBoxes(
当从下拉列表中选择不同的项目时,我试图清除 RadEditor 的内容。以下脚本会在单击“确定”时清除编辑器的内容,但在显示的“确认”框中单击取消按钮时也会清除内容。以下脚本有什么问题?还,在后面的代
我在 asp.net 中有一个 RadioButtonList。我正在尝试做一件简单的事情,即在更改列表中的单选按钮时显示或隐藏 div。但事件 OnSelectedIndexChanged 没有触发
我有两个下拉菜单和一个文本框。我想显示从两个下拉列表中选择的值的乘法。 所以我试图在“OnSelectedIndexChanged”上调用 jquery 函数,甚至是下拉菜单。然而,我在 Visual
我可以在 GridView 的 SelectedIndexChanged 事件上调用 JS 函数吗?我提到了这 2 个 SO 帖子 - Post 1和 Post 2解决了这个问题,但没有帮助。 我试过
我在 ASP.Net Web 应用程序中使用 AJAX ComboBox,并且我有一个 OnItemInserted需要回发才能命中服务器端逻辑的事件但这需要我有 AutoPostBack = Tru
好吧,我在这里有点难过。我在页面上有一个 asp:Dropdownlist。它通过这样的网络服务调用来填充: Ajax.GetSubDevelopments(developmentId, functi
我是一名优秀的程序员,十分优秀!