Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass page to a class and loop through the controls

Status
Not open for further replies.

lunchbox88

Programmer
Feb 17, 2004
208
US
C#

My goal is to validate the text entered in to textboxes to make sure there aren't any illegal characters before it gets written to the database.

My thought is to pass a page (and all it's controls) to a class, loop through the controls on that page to identify all the textboxes,validate the text within those textboxes, and then return a boolean to the page.

Is what I'm thinking even possible? Is there a better way to handle?

 
Yes, it's possible but you will have to create a recursive function as each textbox's parent may not actually be the page.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
This is a pretty silly question, but how do I pass the page to the function?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top