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 August 10th, 2003, 01:25 PM
Authorized User
 
Join Date: Jul 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 11 -- Page 386

Hi,

I am stuck with changing themes. I have checked the code in changeSiteTheme.asp and my template. It is same as of the downloadable code from this web site.

When I select different theme, it does show me its image in Preview fieldset then I click Apply button. It doesn't apply the theme. It remains to default theme. I check the Cookie file and the value has changed in cookie but theme doesn't get changed.

Anyways following is copy of my code:

mainTemplate.dwt.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>

<title>GlobalSoccerEvents.com - Your Source for Soccer Events Aroung the Globe</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<% Dim iTheme
   if Len(Request.Cookies("SiteTheme")) > 0 Then
       iTheme = Request.Cookies("SiteTheme")
   Else
       iTheme = 1 'our default theme
   End If
%>
<link href="../Styles/mainStyles<%=iTheme%>.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="../Images/logo.gif"></td>
    <td align="right"><table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><a href="../home.asp" title="Home Page" id="home">Home</a></td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td><a href="../events.asp" title="View Events" id="events">Events</a></td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td><a href="../mysite.asp" title="Manage MySite" id="mysite">My Site</a></td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td><a href="../admin/admin.asp" title="Administrator Access" id="admin">Admin</a></td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td><a href="../login.asp" title="Login" id="login">Login</a></td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td><a href="../logout.asp" title="Logout" id="logout">Logout</a></td>
      </tr>
    </table></td>
  </tr>
</table>
<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><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 align="center"><br>
      <br><br><br><br><br>
      - Footer Here -</td>
  </tr>
</table>
</body>
</html>


changeSiteTheme.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% If request.Form("btnApply") <> "" Then
    Response.Cookies("SiteTheme") = Request.Form("lstTheme")
    response.Cookies("SiteTheme").Expires = Date() + 30
   End If
 %>
<html>
<head>

<title>GlobalSoccerEvents.com - Your Source for Soccer Events Aroung the Globe</title>
<script language="JavaScript" type="text/JavaScript">
  function changeThemeImage()
  { var iSelectedIndex = document.frmSelectTheme.lstTheme.selectedIndex;
      var iSelectedValue = document.frmSelectTheme.lstTheme[iSelectedIndex].value;
    document.images["imgSiteTheme"].src = 'images/theme' + iSelectedValue + '.gif';
  }
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<% Dim iTheme
   if Len(Request.Cookies("SiteTheme")) > 0 Then
       iTheme = Request.Cookies("SiteTheme")
   Else
       iTheme = 1 'our default theme
   End If
%>
<link href="Styles/mainStyles<%=iTheme%>.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="Images/logo.gif"></td>
    <td align="right"><table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><a href="home.asp" title="Home Page" id="home">Home</a></td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td><a href="events.asp" title="View Events" id="events">Events</a></td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td><a href="mysite.asp" title="Manage MySite" id="mysite">My Site</a></td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td><a href="admin/admin.asp" title="Administrator Access" id="admin">Admin</a></td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td><a href="login.asp" title="Login" id="login">Login</a></td>
        <td>&nbsp;&nbsp;&nbsp;</td>
        <td><a href="logout.asp" title="Logout" id="logout">Logout</a></td>
      </tr>
    </table></td>
  </tr>
</table>
<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><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><h2>Change Site Theme</h2></td>
  </tr>
  <tr>
    <td>
      <table width="670" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="230" valign="top">
              <form action="changeSiteTheme.asp" method="post" name="frmSelectTheme">
                <fieldset style="height: 200px;"><legend>Select a Theme</legend>
                  <span style="display: block; padding: 10px;">
                    <select name="lstTheme" size="3" onChange="changeThemeImage();">
                        <option value="1">Default Theme</option>
                        <option value="2">Orange and Black</option>
                        <option value="3">Large Fonts</option>
                   </select><br><br>
                   <input name="btnApply" type="submit" value="Apply">
                 </span>
                </fieldset>
            </form>
          </td>
          <td width="40" valign="top">&nbsp;</td>
          <td width="400" valign="top">
              <fieldset style="height: 200px;"><legend>Preview</legend>
              <span style="dislpay: block; padding: 10px;">
                <img src="Images/theme1.gif" name="imgSiteTheme" width="400" height="148" id="imgSiteTheme">
              </span>
            </fieldset>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td align="center"><br>
      <br><br><br><br><br>
      - Footer Here -</td>
  </tr>
</table>
</body>
</html>


TIA,
Omer
 
Old August 10th, 2003, 01:43 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 Omer,

It may be possible that your browser uses an old (cached) version of the page. Try reloading the page with Ctrl+F5 (if you're using Internet Explorer) and you'll get a refresh copy from the server.

If that doesn't help, look at the HTML source in the browser. To what file is the CSS <link...> tag linking?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old August 10th, 2003, 05:37 PM
Authorized User
 
Join Date: Jul 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Nice to see you back.
Thanks for your quick response. I had already taken those steps which you mentioned in your reply.

Now I uploaded the entire site and it fixed the problem. Now it is working fine.

Thanks for your help.
Omer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Health Monitoring System - Chapter 3 Page 109 - 11 Laurie S. Stapleton BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 August 31st, 2006 12:13 PM
Chapter 1, page 11 typo? tumana BOOK Beginning Linux Programming, 3rd Edition 4 August 25th, 2006 10:43 AM
Page 352 (Chapter 11) IDisposable Problem sosborne BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 1 August 18th, 2006 05:12 PM
Chapter 11, page 623, struct WNDCLASS Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 0 July 13th, 2006 05:08 AM





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