如何从网格视图中使用的复选框中获取值作为模板字段?
问题描述:
我想做一个客观的问题回答web项目。我使用gridview来显示问题及其选项。我使用chechBox控件作为模板字段来选择答案。如何获取我在复选框中选择的值我点击提交按钮?
I want to make a objective question answer web project .in which i use a gridview to show question and its options.i use chechBox control as a template field for select a answer.How to get value which I select in checkbox when I click on submit button ?
答
在提交按钮点击,你可以循环遍历GridViewRows
并找到CheckBox
控件。然后你可以确定状态。
示例 - 带CheckBox的GridView:在ASP.Net中获取选定的行 [ ^ ]
In Submit button click, you can loop through theGridViewRows
and find thatCheckBox
control. Then you can determine the state.
Example - GridView with CheckBox: Get Selected Rows in ASP.Net[^]