Discussion:
Dynamically Adding Raw HTML
Brady Kelly
2007-07-25 08:25:01 UTC
Permalink
How would I go about adding raw HTML to an element on an ASP.NET page or
control? So, I would e.g. like to have Panel control, and then inject
generated HTML into it, but I can't do this with a Panel because it has no
property to set to the HTML.


===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Ryan Heath
2007-07-25 08:33:15 UTC
Permalink
Hi Brady,

You could you a Literal control for that kind of purpose.

HTH
// Ryan
Post by Brady Kelly
How would I go about adding raw HTML to an element on an ASP.NET page or
control? So, I would e.g. like to have Panel control, and then inject
generated HTML into it, but I can't do this with a Panel because it has no
property to set to the HTML.
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Mark
2007-07-25 08:37:23 UTC
Permalink
I've not done it, but I would think that you could put a literal control
inside the panel and the set it's html?
Otherwise maybe override the panel's Render event?

-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Brady Kelly
Sent: Wednesday, 25 July 2007 8:25 p.m.
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: [DOTNET-WEB] Dynamically Adding Raw HTML

How would I go about adding raw HTML to an element on an ASP.NET page or
control? So, I would e.g. like to have Panel control, and then inject
generated HTML into it, but I can't do this with a Panel because it has no
property to set to the HTML.


===================================
This list is hosted by DevelopMentor. http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor� http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Christopher Frazier
2007-07-25 08:51:39 UTC
Permalink
Post by Brady Kelly
How would I go about adding raw HTML to an element on an ASP.NET page or
control? So, I would e.g. like to have Panel control, and then inject
generated HTML into it, but I can't do this with a Panel because it has no
property to set to the HTML.
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
Generally I use an asp:Literal control for such a situation.
PlaceHolder if I were injecting asp:controls.

hth,
--
-Christopher
| AspInsider
http://www.chrisfrazier.net/blog

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
Continue reading on narkive:
Loading...