Wrox Programmer Forums
|
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2004, 03:37 PM
Registered User
 
Join Date: Nov 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 7 Page 242

Great book guys very informative and accessible.

I'm a little confused by p242 when you say that if you open the template up in your browser and look at the source code the following is displayed..."var sPageName = '/TheSoccarSite/events.asp';"

Nothing is coming up in Firefox 1.0 and I'm not getting anything either when using IE browser. It just displays the following..."var sPageName = `<%=Request.ServerVariables("SCRIPT_NAME") %>';"




 
Old December 12th, 2004, 03:42 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

It should display the name of the current page, and no longer the <%= %> stuff.

Did you save the page with an .asp extension? Otherwise, the page won't be processed by ASP, and you'll end up with the ASP source code, instead of the file name in the HTML source code.

If that doesn't help, can you post the full source of the page?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old December 13th, 2004, 11:36 AM
Registered User
 
Join Date: Nov 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar for replying so swiftly.

At the moment I have a template entitled maintemplate.dwt.aspx and I have created a page from the template by going to File - New - and selecting the main template under soccersite. I noticed that when do save the document it seems to have the extension .asp on the end even though I try and save it as html.

Whats the best procedure to create a html file from the template?

ps please find attached the code from the template:

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>GlobalSoccerEvents.com - Your Source for Soccer Events Around the Globe</title>

</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
    <td><table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><a href="../home.asp" id="home">Home</a></td>
    <td>&nbsp;&nbsp;&nbsp;</td>
    <td><a href=".../events.asp" id="events">Events</a></td>
    <td>&nbsp;&nbsp;&nbsp;</td>
    <td><a href=".../mySite.asp" id="mysite">My Site</a></td>
  </tr>
</table>
</td>
  </tr>
</table>


<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><h2>-Page Title Here- </h2></td>
  </tr>
  <tr>
    <td>-Page Content Here- </td>
  </tr>
  <tr>
    <td><div align="center"><br>
        <br>
        <br>
        <br>
        <br>
        <script language="javascript" type="text/javascript">
        var sPageName = '<%=Request.ServerVariables("SCRIPT_NAME")%>';
        sPageName = sPageName.substr(sPageName.lastIndexOf('/')
                                    + 1) .toLowerCase ();
        sPageName = sPageName.substr(0, sPageName.lastIndexOf('.'));
        if (document.getElementById(sPageName))
        {
        document.getElementById(sPageName).style.fontweigh t = 'bold';
        document.getElementById(sPageName).style.fontSize = '14pt';
        }
        </script>
        -Footer Here-</div></td>
  </tr>
</table>
</body>
</html>




 
Old December 14th, 2004, 04:38 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Why do you want to save it as an HTML file? For the ASP code in the file to work correctly, the file *has* to be saved with an ASP extension.

Maybe your file has a double extension (e.g. .asp.html) but you only see one in Windows because you have "Hide extensions for known filetypes" on?

I also noticed you have a file called maintemplate.dwt.aspx and a Page Language="VB" directive. It looks like you're mixing classic ASP pages with .NET ASPX pages??


Imar





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 7 - page 212 asplundo BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 3 February 2nd, 2008 06:56 AM
Chapter 7 Try It Out page 218 drumdiva BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 3 March 19th, 2007 08:35 PM
Chapter 9, Try it out Page 338, C# tbroom BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 October 3rd, 2006 03:43 AM
Chapter 1 Page 16 - Try It Out bradnerdhss BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 January 31st, 2006 02:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.