我创建动态单选按钮列表如何更改标识停止ASP.NET为了执行某些操作
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
如何停止更改ID的asp.net S IN为了执行操作这样
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
'C#'标签似乎毫无意义。 –
你不需要 - 'FindControl'使用服务器端的ID,而不是ClientId。 –