我有一个网格。网格中有多个值。假设网格中有候选Id列,并且每行都有复选框。我想通过复选框选择候选Id的多个值,并将单个查询字符串中的多个选定值传递给另一个页面。传递后,我将使用 split() 函数并保持在数组中。因为我必须使用这个多个候选id在目标页面上执行一些操作。请给我一些解决这个问题的办法。
split()
这是我的格子。 我没有在这个代码中包含复选框
<asp:GridView ID="grdReq" runat="server" AutoGenerateColumns="false" CssClass="SimpleGrid" OnRowDataBound="grdReq_RowDataBound"> <Columns> <asp:BoundField DataField="CandidateID" HeaderText="Candidate Id" /> <asp:BoundField DataField="Candidate Name" HeaderText="Candidate Name" /> <asp:BoundField DataField="Current Organization" HeaderText="Current Organization" /> <asp:BoundField DataField="Current Designation" HeaderText="Current Designation" /> <asp:BoundField DataField="Overall Exp" HeaderText="Overall Exp" /> <asp:BoundField DataField="Qualification" HeaderText="Qualification" /> </Columns> </asp:GridView>
好吧,我在不久的过去做过这样的事情,程序是:
StringBuilder sb = new StringBuilder(); sb.Append(yourcheckbox); sb.Append(",");
在接收时,您可以使用“,”将其拆分,并且您将拥有所有复选框。
祝你好运