Connecting Tech Pros Worldwide Forums | Help | Site Map

does not contain a definition for controls

boss32178's Avatar
Newbie
 
Join Date: Jun 2009
Location: Ft. Worth Tx
Posts: 5
#1: Jun 11 '09
I get this build error
does not contain a definition for controls
here is my code...

//XML HEADER
XMLWriter.Formatting = Formatting.Indented;
XMLWriter.WriteStartDocument(true);
XMLWriter.WriteStartElement("ConditionReport");
//XML DETAIL
//LOOP THROUGH FORM ITEMS AND WRITE TO XML
foreach (Control C in this.Controls)

Thank you,



Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#2: Jun 11 '09

re: does not contain a definition for controls


"this" does not have a Controls property
boss32178's Avatar
Newbie
 
Join Date: Jun 2009
Location: Ft. Worth Tx
Posts: 5
#3: Jun 11 '09

re: does not contain a definition for controls


thank you for your help i got it working i had to

first
public class XMLClass : System.Web.UI.Page

then
public Page PageObject
{
get{ return _page;}
set{ _page = value; }

}

foreach (Control C in _page.Controls )


that seems to work...
Reply