trying to access an embedded html control within a web control

J

Joe Stampf

I'm a bit new to asp.net programming (although definitely not a dotnet
rookie!) so I'm not sure if this is the right/best way to do this.

I am building a webcontrol for a shopping cart app that accepts as a
property some html to render, including at the very least a form textbox
<input type=text>, and also an associated property that specifies the 'id'
of that form textbox. (The web control is always inside an html form).
The web control then renders the supplied html in its overridden
'RenderContents' method.

Now, the web control's html and form textbox show up fine in the client
browser, but unfortunately I can not programmatically access the form
textbox from the code behind, as with Page.findcontrol("xxx"), or any other
way...

I think this is because it is not explicitly added to any [child] controls
collection (I was hoping it would get added automatically by the framework).

Does anyone know how I can programmatically access this dynamically
generated form textbox in the code behind? I am not sure I want to add it
as a child control b/c --I think-- that would require *every* html tag to be
hard-coded as nested child controls, thus losing the ability to just accept
a custom html property string to render.

Thanks for any help you pros can offer!
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top