handles a control in a formview in asp.net

女生的网名这么多〃 提交于 2020-01-25 09:10:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!