Usercontrol outputting html programmatically

S

Sosh123

Hi,

Could someone please explain to me the propper way of having a user
control spit out some html from code-behind (at the position it is
placed in the parent document)? I initially thought just
Response.Write, but I discovered that this dumps the output at the top
of the page regardless of the postition of the user control.

Do i need to add a placeholder or literal to the aspx view of the user
control (an then have the code behind write to this)? Should I be using
something other than Response.Write (HTMLWriter for instance)?

Any info appreciated!
 
P

Peter Rilling

You would need to have some placeholder such as a <div>. You should then be
able to write whatever HTML you want at that position.
 

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,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top