Connecting Tech Pros Worldwide Help | Site Map

Noob question about returning HTML

ToChina
Guest
 
Posts: n/a
#1: Nov 19 '05
Hi, I have a simple web page which has a file upload section, where the user
can select a file, hit the upload button, and then view details about the
file, which appear underneath the upload section.

The information about the file will be returned as XHTML, therefore I want a
control on the web form which is just a container for HTML so that in my
code behind file I can do something like:

// if file has successfully uploaded

htmlContainer.Text = "<table><tr><td>Whatever details</td></tr></table>";

I can't seem to find an appropriate control. What am I missing? apart from
a brain.

I could use the Response class, but I don't want to lose the file upload
section at the top of the form.


John Timney \(ASP.NET MVP\)
Guest
 
Posts: n/a
#2: Nov 19 '05

re: Noob question about returning HTML


The correct way would be to look at using a placeholder control and put
other controls in it - like table controls or labels.
--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"ToChina" <invalid@email.address> wrote in message
news:uKCpe.47252$G8.5001@text.news.blueyonder.co.u k...[color=blue]
> Hi, I have a simple web page which has a file upload section, where the
> user can select a file, hit the upload button, and then view details about
> the file, which appear underneath the upload section.
>
> The information about the file will be returned as XHTML, therefore I want
> a control on the web form which is just a container for HTML so that in my
> code behind file I can do something like:
>
> // if file has successfully uploaded
>
> htmlContainer.Text = "<table><tr><td>Whatever details</td></tr></table>";
>
> I can't seem to find an appropriate control. What am I missing? apart
> from a brain.
>
> I could use the Response class, but I don't want to lose the file upload
> section at the top of the form.
>[/color]


ToChina
Guest
 
Posts: n/a
#3: Nov 19 '05

re: Noob question about returning HTML


"John Timney (ASP.NET MVP)" <timneyj@despammed.com> wrote in message
news:%23ooEslDbFHA.2420@TK2MSFTNGP12.phx.gbl...[color=blue]
> The correct way would be to look at using a placeholder control and put
> other controls in it - like table controls or labels.
> --
> Regards
>
> John Timney
> ASP.NET MVP
> Microsoft Regional Director
>[/color]

I've found a method that works - I don't know if there's anything wrong with
it, but basically I've added the following to the web form:

<div id="container" runat="server"></div>

and then in the code behind I have this:

protected System.Web.UI.HtmlControls.HtmlContainerControl container;

container.InnerHtml = "<table>...</table>";

now the HTML gets rendered right on the page.


Closed Thread