Hi all,
I think my problem lies in not being able to find controls after performing a ChangeMode on a FormView.
Much simplified code:
Code:
if (true)
{
FormView1.ChangeMode(FormViewMode.Edit);
Trace.Write (((TextBox)FormView1.FindControl("SomeEditControl")).Text);
}
This results in "Object reference not set to an instance of an object".
The idea is to have a FormView which is set to Edit mode when a certain datafield is NULL, and give the databound TextBox a default value retrieved from a Cookie.
How should I access the TextBox control?
Hope you can help,
Peter