【发布时间】:2015-08-16 03:39:38
【问题描述】:
已解决
我正在使用 C# 编写 ASP.NET 项目并将我的数据存储在 MYSQL 上。我的问题是我可以解析 url 并且可以填充 KayitAyrinti.aspx 的文本框、文本区域但不能为单选按钮列表做到这一点。
我该如何解决这种情况?
这是 KayitAyrinti.aspx;
<asp:RadioButtonList ID="RadioButtonList_ayrintiGorusmeYapilanOkul" runat="server" Width="174px">
<asp:ListItem Text="Seyrantepe Şube 1" Value="Seyrantepe Şube 1"></asp:ListItem>
<asp:ListItem Text="Seyrantepe Şube 2" Value="Seyrantepe Şube 1"></asp:ListItem>
</asp:RadioButtonList>
KayitAyrinti.aspx.cs;
using (MySqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
RadioButtonList_ayrintiIlgilendigiBolum.SelectedValue = (reader["gorusmeYapilanOkul"].ToString());
}
}
【问题讨论】:
-
具体问题是什么?我猜你想分配正确的参数值。,然后不要使用
Value="Seyrantepe Şube 1"而是Value="1"。
标签: c# mysql asp.net radiobuttonlist