0
我有以下gridview。關注gridview中的footerrow
<asp:GridView ID="gvMarks" runat="server" AutoGenerateColumns="false"
DataKeyNames="MarkId" Width="80%" onrowdatabound="gvMarks_RowDataBound"
ShowFooter="True" onrowcommand="gvMarks_RowCommand">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
SubjectCode
</HeaderTemplate>
<FooterTemplate>
<asp:DropDownList ID="dlSubjectCode" runat="server" width="100px" AutoPostBack="false"></asp:DropDownList>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Mark
</HeaderTemplate>
<FooterTemplate>
<asp:TextBox ID="txtInternalMark" runat="server" ></asp:TextBox>
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Insert
</HeaderTemplate>
<FooterTemplate>
<asp:LinkButton ID="lnkInsert" runat="server" Text="Insert"
CommandName="Insert" ></asp:LinkButton>
</FooterTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="White" ForeColor="#000066" />
<RowStyle ForeColor="#000066" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
</asp:GridView>
如果我進入txtInternalMark一定的價值,IAM不代碼behind.Iam歌廳它的價值歌廳值「」 .Iam使用下面的代碼
if (e.CommandName.Equals("Insert"))
{
TextBox txtInternalMark = (TextBox)gvMarks.FooterRow.FindControl("txtInternalMark");
lblMessage.Text = txtInternalMark .Text;
}
能
任何人的幫助來獲取值代碼隱藏中的文本框。