我正在创建动态单选按钮列表
Dim rdbQuestion As New RadioButtonList
并且动态ID为
rdbQuestion.ID = "Question_" & row("Id").ToString
当页面呈现单选按钮列表的ID变为类似
时AssessmentPerforma_Question_1, AssessmentPerforma_Question_2, AssessmentPerforma_Question_3..... AssessmentPerforma_Question_n
如何阻止asp.net更改ID以执行此类操作
Sub btnSave_click(ByVal sender As Object, ByVal e As EventArgs)
Dim rbl As RadioButtonList = DirectCast(Page.FindControl("Question_1"), RadioButtonList)
Response.Write(rbl.SelectedValue)
End Sub
答案 0 :(得分:2)
添加此行....
rbdQuestion.ClientIDMode = ClientIDMode.Static