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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsign children of user controls

Status
Not open for further replies.

GIGN

Programmer
Oct 6, 2000
1,082
NZ
I am having trouble getting the parser to create objects when it parse child nodes with a User Control, I have had no trouble when using a Server Control.

I am filling an ArrayList with the child controls - but they are filled with nothing - no objects have been created.

I think it has something to do with the way they are declared



<Toolkit:Upload id=&quot;UPLOADER&quot; runat=&quot;server&quot;>
<Parameter Name=&quot;something&quot; Value=&quot;some Value&quot;/>
<Parameter Name=&quot;something-else&quot; Value=&quot;nothing&quot;/>
</Toolkit:Upload>


My output tells me my array has 2 things in it - but they are empty.

I have a class in the source dll for the ascx page corresponding to the Upload control called Parameter, which should be created when the Parameter tag is created.

If I try using Toolkit:parameter - then I get an error.

 
Turns out we have to register the child elements so the parse can find them to create them.


<%@ Register TagPrefix=&quot;Toolkit&quot; TagName=&quot;Upload&quot; Src=&quot;upload/Upload.ascx&quot; Assembly=&quot;Upload&quot; %>
<%@ Register TagPrefix=&quot;Toolkit&quot; Namespace=&quot;Toolkit&quot; Assembly=&quot;Upload&quot; %>



<Toolkit:Upload id=&quot;UPLOADER&quot; runat=&quot;server&quot;
maxWidth=&quot;200&quot; maxHeight=&quot;400&quot;
maxByteSize=&quot;20000&quot;
destinationDirectory=&quot;../_database/&quot; debug=&quot;false&quot;
thumbDirectory=&quot;../_database/thumbnails/&quot;
httpBasePath=&quot;_database/&quot;
uploadNumber=&quot;7&quot;
>
<Toolkit:parameter Name=&quot;id&quot; Value=&quot;12&quot;/>
</Toolkit:Upload>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top