I wish I could go all the elements of an ASP.Net page (HTML elements) and manipulate its text property / value. How could I do that?
I've been checking, and the property this.Page.Form.Controls apparently gets all the elements, but I would only page elements that caught the event. Does anyone have any idea.
I'll put an example of code that I'm currently studying and trying adpater for my needs.
Thanks
string x = String.Empty;
string y = String.Empty;
foreach (Control ctrl in this.Page.Form.Controls){
if (ctrl is TextBox){
x += ((TextBox)(ctrl)).ID + ((TextBox)(ctrl)).Parent + "\n";
} else {
y += ctrl.GetType().Name + ctrl.GetType().Namespace + "\n";
}
}
Obs.: I am using some components of the Telerik components.