add html fragment (and controls) to control tree

T

Terry V

Thanks for any help...

I have a user control which includes among other controls an htmlholder.

At runtime I pick up an html fragment from a web service (not mine) that
looks like <form ... /form>. Within the fragment could be any controls but at
the moment I am just working with an html input text and submit.

I take the fragment (process it for some information) and then assign it to
a literalcontrol that is added to the htmlholder.controls collection.

The fragment is rendered just fine and any controls such as hyperlinks
function properly when clicked.

My problem is that when an htmlinput submit is clicked, causing a postback,
I need to inspect the control tree to see the value of the htmlinput text,
and then pass it back to the web service to be processed.

I'm recreating the html fragment on postback during the Page_Init. But the
controls are not in the control tree when I look for them after page_load, in
the pre_render.

I suspect that I should not use the literalcontrol for this process but am
unsure of where to go. Even if I assign the html fragment to another control
that might render it, how do I get the html converted into the controls and
added to the control tree? Am I going to have to read the fragment, check for
tags and add each control as I come across it? Is there something out there
that will that would do this - like an htmltextreader? Or can someone suggest
a good abstraction so I don't have to know what each control is to get it and
it's properties into the control tree?

This should be fun!
 

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top