Site template pointers required....

P

Paul Baker

Hi,

Can someone point me in the right direction as I'm a relative novice
with .Net?

I'm creating an intranet site with the same basic structure for every
page (top & bottom bars, menu on left and content middle right) (done
with user controls.)

It's the content bit I'm having problems with.... If I have some
content that a user has uploaded and is html (like an include file might
be) and I have the location of that file (in a separate virtual
directory) how do I get that html inserted into my page at run time?

I have been searching help/google etc for template, but that relates to
datagrids/lists etc. I'm not necessarily looking for loads of code, but
if someone could point me in the right direction, at least I'll know
that I'm looking in the right area. (Could I use load template with
ascx files or am I looking in the wrong place?)

Ideally, I'd like my pages to be something like this

http://server/application/getpage.aspx?id=79 where 79 is the ID of a
table row containing the location of the stub file to insert.

Many Many thanks,

Paul
 
F

Felbrigg

I've done something like this. Are the users posting entire HTML pages or
just the contents of the <BODY> tag.
If they are you might open the file with a filestream read the contents into
a string and then insert that using the "InnerHTML" into a <TD> tag. For
this you will have to set up this

<TD id="theMainCell" runat=server></TD>

However if entire HTML pages are being uploaded, you might try another
implementation as follows.

Create a user control that only contains an IFRAME. Then use the attributes
of the IFRAME to point it at the uploaded page. thus ( in this example
LoadHTMFrame is the id of the IFRAME tag).

LoadHTMFrame.Attributes.Add("src", "StaticPages\" &
HttpUtility.UrlDecode(Request.QueryString("PageName")))
 
P

Paul Baker

Felbrigg said:
I've done something like this. Are the users posting entire HTML pages or
just the contents of the <BODY> tag.

I haven't quite decided whether I'll strip the said:
If they are you might open the file with a filestream read the contents into
a string and then insert that using the "InnerHTML" into a <TD> tag. For
this you will have to set up this

<TD id="theMainCell" runat=server></TD>

OK, I'll try that....
However if entire HTML pages are being uploaded, you might try another
implementation as follows.

Create a user control that only contains an IFRAME. Then use the attributes
of the IFRAME to point it at the uploaded page. thus ( in this example
LoadHTMFrame is the id of the IFRAME tag).

LoadHTMFrame.Attributes.Add("src", "StaticPages\" &
HttpUtility.UrlDecode(Request.QueryString("PageName")))

Cheers, that's what I do for PDF's that users upload.

I'll have a play tomorrow......
 

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,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top