所以我有一个sipme ASP.NET网页,用于打印在单选按钮列表中动态堆叠的一个性别的信息:
$(window).on("beforeunload", function() {
return confirm("Do you really want to close?");
})
然而,当我启动网站时,无论我选择它,它总是写女性,就像RadioButtonList1.SelectedIndex == 0不起作用。
有什么想法吗?
答案 0 :(得分:1)
radiobuttonlist
page_Load
!IsPostBack
与[{1}}条件绑定,或者radiobuttonlist
每次发帖都会绑定radiobuttonlist
。因此,当您点击-1
时,button_click
会重置为索引 protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
String[] genders = new String[2];
genders[0] = "Male";
genders[1] = "Female";
RadioButtonList1.DataSource = genders;
RadioButtonList1.DataBind();
RadioButtonList1.Items.Add(new ListItem("Neutral", "Zero"));
}
}
。
# - "-r"
# - "arn:aws:iam::**********:role/**********"