Powered by Blogger.

Finding controls in Formview


Hi
try this example to find control in Formview
1
2
3
4
5
6
7
8
9
10
11
12
protected void FormView1_DataBound(object sender, EventArgs e)
{
if (FormView1.CurrentMode == FormViewMode.ReadOnly)
{
TextBox txt = FormView1.FindControl("TextBox1") as TextBox;
 
if (txt != null)
{
// Do something here
}
}
}
Good Luck

No comments