How do I find a link in the form to write code to change the mode?

I have a web form that contains a form like (fv). how can I find a link in it (lnkbtnEdit) to write the code to change the mode?

Thank you

0


a source to share


2 answers


Your question is rather vague, so I will try to keep my answer as general as possible.

Container Controls in ASP.NET provide a FindControl method that uses Reflection to find a control with a specified name in its child controls.Using this method is the accepted method for finding controls in a Page or Templated Control Panel, such as FormView.



If you want to avoid Reflection, you can also find the control manually if you know the index of the control in the hierarchy.

Also, it is very helpful to know the point in time at which you need to access that control, because it is quite possible that the child control has not been created yet (see my comment on your question.)

0


a source


Cerebus, Thanks for your answer .... but it seems that I cannot select lnkbtnEdit inside fv. If I could, I would just select it as a design, and in the events section of the properties window, I could write a handler to click it ....



0


a source







All Articles