问题
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
回答1:
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.
来源:https://stackoverflow.com/questions/7128764/handles-a-control-in-a-formview-in-asp-net