If I am in Edit mode, I am able to access my textboxes in the Edit Template using code such as this:
FormViewRow FVrow = FormView1.Row;
DropDownList dd;
dd = (DropDownList)FormView1.FindControl("ddActive_Flg");
dd.SelectedValue = "Y";
However, if I try this after setting the FormView to Insert mode, the FormViewRow is still null immediately after binding the data. What technique can I use in order to access the controls in my FormView when there are not yet any rows in my binding datasource?
FormViewRow FVrow = FormView1.Row;
DropDownList dd;
dd = (DropDownList)FormView1.FindControl("ddActive_Flg");
dd.SelectedValue = "Y";
However, if I try this after setting the FormView to Insert mode, the FormViewRow is still null immediately after binding the data. What technique can I use in order to access the controls in my FormView when there are not yet any rows in my binding datasource?