Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 February 17th, 2005, 11:50 AM
Authorized User
 
Join Date: Jul 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default Session Variables and Dates

I am trying to set a session variable to pass between pages. It only seems to work if I print the variable to the page before I try to reference the variable. The code setting the variable is:

<%

var varStartDate = new Date();

Session("varStartDate") = varStartDate;

var strStartDate = (Session("varStartDate").getMonth() + 1) + "/" + Session("varStartDate").getDate() + "/" + Session("varStartDate").getFullYear();

Session("strStartDate") = strStartDate;

    %>

<SCRIPT LANGUAGE = JavaScript>
    window.top.main.location='DisplayMonthlySchedule.a sp';
</SCRIPT>

Using this code, when "DisplayMonthlySchedule.asp" runs, I get an error:

Response object error 'ASP 0185 : 8000ffff'
Missing Default Property

/Scheduling/DisplayMonthlySchedule.asp, line 162

A default property was not found for the object.


If I change the original code to (change in red):

<%

var varStartDate = new Date();

Session("varStartDate") = varStartDate;

var strStartDate = (Session("varStartDate").getMonth() + 1) + "/" + Session("varStartDate").getDate() + "/" + Session("varStartDate").getFullYear();

Session("strStartDate") = strStartDate;

    %>
    varStartDate = <%=Session("varStartDate")%><br>
    strStartDate = <%=Session("strStartDate")%><br>
<SCRIPT LANGUAGE = JavaScript>
    window.top.main.location='DisplayMonthlySchedule.a sp';
</SCRIPT>


Things work just fine. The problem is that I don't want these dates showing up on the browser. Anyone know what this error means and how to eliminate it?

It appears that:

Session("strStartDate") = strStartDate; this passes fine
Session("varStartDate") = varStartDate; this generates error above


Thanks for your help!

Rich


__________________
Ego is a faithful friend; He stays with us all the way to the crater.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Variables in C# shikha09 C# 1 November 28th, 2006 10:38 AM
Is it possible for me using session variables into see07 ASP.NET 1.x and 2.0 Application Design 4 March 9th, 2005 07:46 PM
Session Variables - help? Annoyamouse BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 11 August 31st, 2004 03:56 PM
Session Variables flesh_god Dreamweaver (all versions) 7 November 11th, 2003 05:52 PM
session variables help face Classic ASP Databases 4 September 12th, 2003 03:57 PM





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