Re: impossible or not: dynamically embedding a user control in the middle of a string?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



The binding idea is creative and will probably suit my needs. Thank you very
much for the suggestion.

-KF


"Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:uP7PUT$JHHA.3604@xxxxxxxxxxxxxxxxxxxxxxxxx
Hello KF,

From your description, you want to dynamically create a usercontrol and
embed it into a large text string paragragh(retrieved from database),
correct?

Based on my experience, it depend on whether the usercontrol can be
embeded
in a fixed place in your text paragragh. For example, if the usercontrol
is
always embeded in the middle of your text pragraph, you can divide the
text
string into two substrings and bound on the page(databinding) into two
place, thus, you can put a placeholder between them, and dynamically load
the usercontrol into the placeholder at runtime.

If this is not the case, I'm afraid we can not dynamically insert a
usercontrol or other ASP.NET server control into discretionary postion in
a
plain text paragraph.

BTW, do you think it is possible to replace the usercontrol with an html
image element? (<img src=.... />) If so, you can consider insert a <img>
tag into your text paragraph and let the image link to a dynamic generated
image stream. How do you think?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no
rights.



.



Relevant Pages