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 October 27th, 2005, 12:38 PM
Authorized User
 
Join Date: Oct 2005
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using The Global.asa File

Hiya, I am working my way through the book, and I am now on chapter 8 (page 294 to be ezact!) I have just entered the code to tell the user what date the user has been browsing since etc, however when I try it my browser says,

You have been browsing this site since which was 3339599825 seconds ago.

The code i have entered is,

You have been browsing this site since <% = Session ("StartTime") %>
        which was <% = datediff ("S", Session("StartTime"), Now( )) %>
        seconds ago.



I cant think what I have done wrong! Any help would be much apritiated!!

Mike

 
Old October 27th, 2005, 04:01 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 Mike,

You'd get this error when Session ("StartTime") doesn't have a value.

Are you sure it's set correctly in global.asa and in the right event? (Session_OnStart)?

Other things to check:

1. Do you have a cookie blocker? ASP Session state relies on cookies so your browser must be able to receive cookies.

2. Is the folder that holds the global.asa file configured as an application in IIS? If it's just a simple sub folder in the root of your site, the events in the global.asa file won't fire and Session ("StartTime") will never get a value.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 29th, 2005, 06:56 AM
Authorized User
 
Join Date: Oct 2005
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Thanks for the quick reply! I have sorted it now, I didnt change the global.asp to a .asa file! To many late nights I think!:D

Thanks again for the help,

Mike

 
Old October 15th, 2006, 09:05 PM
Registered User
 
Join Date: Oct 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am having a similar problem. I get the same superlong seconds and no date on my page. I am using a webhosting server to test my pages out because I do not have XP Professional. I uploaded the global.asa file but I do not think it is even being used because when I delete it from the root drive of my websapce, it doesn't even make a difference. I am a newbie to all of this. What am I doing wrong? I do know that my web host has me on a Windows Server and I have asp because everything up to page 267 has worked for me.

Please help.

Erik

 
Old October 16th, 2006, 01:29 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Erik,

You need to check with your host and see if they support the global.asa file.

For the global.asa file to work, your root folder must be configured as an application in IIS.

Also, check if you can accept cookies from the site. Is there anything public we can test?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old October 16th, 2006, 03:57 PM
Registered User
 
Join Date: Oct 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for the quick reply!!!! I read that you reply quickly when I was reading reviews about your book.

I contacted my host and they stated that they do in fact support the global.asa file. I can accept cookies too. They referred me to a FAQ. I can't say I totally understand it. Please let me know if you think I can make this work with my host. It is as follows:

Where do I place all the CodeBehind files for a .NET Version 2.0?

Ensure all your domains are pointing to the root (/.) and you are redirecting them to different folders using a default.asp script.



<%EnableSessionState=False

host = Request.ServerVariables("HTTP_HOST")

if host = "test.com" or host = "www.test.com" then
response.redirect("http://domain1.com/domain1/index.aspx")

elseif host = "tranquilhome.com" or host = "www.tranquilhome.com" then
response.redirect("http://domain2.com/domain2/index.aspx")

else
response.redirect("http://domain1.com/error.htm")

end if
%>


With this kind of setup, you can place the codebehind files in a "bin" folder. And
the "bin" folder can then be placed in the respective folders the domain is pointing
to.

For example: the codebehind files for domain1.com can be placed in the folder
domain1. (/domain1.com/bin)

Please note
The web.config can go into the respective folders too.



 
Old October 17th, 2006, 01:24 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Erik,

The FAQ you posted is for ASP.NET 2.0.

However, the books Beginning Dreamweaver MX / MX 2004 deal with "classic" ASP. Which technology do you intend to use?

Are you sure your host got that right? Do they in fact have support for classic ASP and do they have the same type of FAQ for that technology?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Are functions allowed in global.asa file mat41 Classic ASP Basics 1 January 10th, 2008 01:58 AM
how to include file in global.asa beetle_jaipur Classic ASP Basics 1 April 18th, 2006 03:46 AM
Debugging Global.asa file arimakidd Classic ASP Professional 1 August 23rd, 2005 03:15 PM
Global.asa File Help gmoney060 Classic ASP Basics 19 September 27th, 2004 10:13 PM





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