Julio
Julio

Reputation: 31

handles a control in a formview in asp.net

How can I do a handles from a control contened in a formview, in code only i can see formview but not the controls in the inserttemplate.

thank for any help

Upvotes: 0

Views: 339

Answers (1)

Muhammad Akhtar
Muhammad Akhtar

Reputation: 52241

You have to use the FindControl method to find a control.

TextBox txtEmail = (TextBox)FormView1.FindControl("ControldID");

This is because the controls that are in the DataBound Controls are not directly accessible. To Access these controls, you have to use the FindControl method and cast it in appropriate control.

Upvotes: 1

Related Questions