Author: ptcoder | Posted on: 10/6/2008 9:26:09 AM | Views : 378

Hello everyone. I seem to have a strange situation here. I am simply trying to clear a login form field on page load and I get "Object reference not set to an instance of an object. " I have updated TextBox fields many times via code, but not in a FormView. That seems to be the difference. I tried the FindControl function, but no luck. I appreciate any help you can offer!!

Here is my code in the Page_Load:
FormView1.ChangeMode(FormViewMode.Edit);
System.Web.UI.WebControls.TextBox clearLogin = (System.Web.UI.WebControls.TextBox)FindControl("LoginTextBox");

clearLogin.Text = ""< ...

Go to the complete details ...