Having:
<asp:FormView ID="frmEmployee" runat="server">
<EditTemplate>
<asp:TextBox ID="txtFirstName" runat="server" />
</EditTemplate>
</asp:FormView>
one uses FindControl to reference the txtFirstName textbox in the code-behind file:
VB.Net
Dim txtFirstName As TextBox = CType(Page.FindControl("txtFirstName"), TextBox)
txtFirstName.Text = "George"
C#
TextBox txtFirstName = (TextBox)Page.FindControl("txtFirstName");
txtFirstName.Text = "George";
is there a way to reference this control statically, without having to use FindControl?
VB.Net
txtFirstName.Text = "George"
C#
txtFirstName.Text = "George";