I would like to know whether or not this control is null once the page loads before I perform another operation. At the moment it just throws the object reference error.
protected void FormView1_DataBound(object sender, EventArgs e)
{
if (FormView1.CurrentMode == FormViewMode.ReadOnly)
{
string cname =
(this.FormView1.FindControl("companyname") as
System.Web.UI.WebControls.TextBox).Text;
if (cname == null)
{
}
else{
}
}
}