Hi Dave,
If you are bounding controls in FormView InsertItemTemplate, then
you need to manipulate the control content in PreRender method. You
cannot set the textbox value in Page_Load event.
1. Attach the PreRender event for FormView Control.
2. Find the control you are looking for.
3. If the control is present, set the value.
protected void FormView1_PreRender(object sender, EventArgs e)
{
Control ctrl =
this.FormView1.FindControl("CompanyNameInsertInsertItemTextBox");
TextBox txt = ctrl as TextBox;
if (txt != null)
{
txt.Text = "Hai"; //Set like this.
}
}
There may be better way(s) than this. I hope it may help you.
After Hours of Failure...a solution that works! Thanks Karthik!
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.