Solved

Problems getting a server-side include working

Posted on 2009-07-13
5
166 Views
Last Modified: 2012-05-07
Please take a look at these 2 pages and let me know what else I need to get the headet included in the other page? Does the server-side include work in an html file, or does it need to be php or asp.net?

http://travelnursecpa.com/header.html
http://travelnursecpa.com/index_wInclude.html

I don't really know if I have this question in the right zones, so please let me know what zones would be appropriate.

Thanks!

John
0
Comment
Question by:gabrielPennyback
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
sevensnake77 earned 500 total points
ID: 24843556
Server sides work in asp.net or php server side code.  Unless you can delcare the variable for html to read it, it will not work.
0
 
LVL 1

Author Comment

by:gabrielPennyback
ID: 24844184
Excellent thanks. So  since I'm slightly more familiar ASP.NET than PHP (I know how to do registration and login),  am I correct that I have to put my html inside an asp.net form and save as  an aspx file?

Having done that, how and where do I declare the variable? Exactly what code would constitute the entire complete variable,  and where would it go? Would it go in the aspx.cs file or the aspx file or both?

Thanks,

John
0
 
LVL 9

Assisted Solution

by:sevensnake77
sevensnake77 earned 500 total points
ID: 24844385
This is where I have one of mine.
  </script>
</HEAD>
 <body>
  <!--#include virtual="\menus\header.asp" -->
  <form id="Form1" method="post" runat="server">
 
 
0
 
LVL 1

Author Comment

by:gabrielPennyback
ID: 24844695
Excellent, thanks! I couldn't get yours to work as is but I did get something very similar working. See the 3 codes below.

I've noticed that the files to be included don't have to be aspx, html will do just fine. Only the calling file has to be aspx, and in any event the files to be included can not have a page directive when they are aspx files.

Thanks a lot,

John

TESTINDEX1.HTML
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>INDEX</title>
</head>
<body>
 <form id="Form1" method="post" runat="server"> 
 <!--#include virtual="TestHeader1.aspx" -->
 Blah, blah, blah ...
  <!--#include virtual="Wisdom.aspx" -->
 </form>
</body>
</html>
 
TESTHEADER1.ASPX
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HEADER</title>
<style>
#header{width:890px; height:30px; padding:50px 0; text-align:center; background:#33CCCC; border:2px solid white}
</style>
</head>
<body>
<div id="header">
This is my header
</div>
</body>
</html>
 
WISDOM.ASPX
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
"One should never increase, beyond what is necessary,
the number of entities required to explain anything."
</body>
</html>

Open in new window

0
 
LVL 1

Author Closing Comment

by:gabrielPennyback
ID: 31602992
Thanks again.
0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question