D
David C
Is there a way to loop through all TextBox controls of a FormView and blank
them out? Thanks.
David
them out? Thanks.
David
Mr. Arnold said:Yes, you can loop through all the controls on the Web from, check what
type of UI control object it is, and address the properties of the UI
control object.
ctrl.Text = "" if the control has a Text property, as an example.
http://dotnetcoderoom.wordpress.com/2009/03/07/traverse-loop-through-all-form-controls-in-aspnet/
Mr. Arnold said:I mislead you. The example I gave you was loop on a Web form not a
FormView.
You may still need a loop using the FormView.FindControl.
http://geekswithblogs.net/azamsharp/archive/2006/05/22/79294.aspx
HTH
Actually, a FormView is a single-row control and not a grid/table.Mr. Arnold said:A FormView is a databound control based on rows like a table, right?
If it were me, I would find a way to loop through the table rows, find the
control, an object, I was looking for on the row using FV.FindControl(),
and address the object's properties. Having not worked with a FV, I would
suspect that is the way it must be done.
The example provided shows you how to find the control on the FV. It's up
to you to think outside of the box and find a way to implement the
solution to address the problem.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.