I have added a checkbox (chkCtrl) column into a gridview, when the checkboxes are selected i want to grab the email address that corresponds to that row and store all the results in a list or array. I would like this to happen when the 'Send Email' button is clicked.
Gridview Code ASP.net
<asp:GridView CssClass="table table-hover" BorderWidth="2px" ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="GrabModuleID" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" >
<Columns>
<asp:CommandField EditText="" ShowSelectButton="True" SelectText="View Student Details" />
<asp:BoundField DataField="StudentNo" HeaderText="Student Number" SortExpression="StudentNo" />
<asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
<asp:BoundField DataField="UserID" HeaderText="UserID" SortExpression="UserID" Visible="false" />
<asp:BoundField DataField="ModuleID" HeaderText="ModuleID" SortExpression="ModuleID" Visible="false" />
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkCtrl" runat="server" />
</ItemTemplate>
</asp:TemplateField>
Send email button code:
<asp:Button ID="SendEmail" runat="server" class="btn btn-primary" Text="Send Class Email" OnClick="SendEmail_Click" />
Aucun commentaire:
Enregistrer un commentaire