473,372 Members | 1,051 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Help - Can someone please tell me what I'm doing wrong here?

I'm going out out of my mind trying to get this to work with no luck. The
error message I get is at the bottom. Can someone please tell me what I'm
doing wrong here. I've tried this a million different ways and can't get it
to work. I can get it to work with VBScript, but I need to do this project
in JavaScript. HELP- PLEASE!?

<%@Language=JavaScript%>
<%Response.buffer=true%>

<%
if(Request.Form("txtusername") == "" || (Request.Form("txtpassword") == ""))
{
%>

<HTML>
<HEAD>
<meta http-equiv="Content-Language" content="en-us">
<title>Error Information</title>
</HEAD>
<BODY>

<Some HTML text Here>
<%
}
else
{

ExpireDate = new Date();
ExpireDate.setYear = (ExpireDate.getYear() + 1);

Response.Cookies("User").expires = ExpireDate.toLocaleString();

Response.Cookies("User")("UName") = Request.Form("txtusername");
Response.Cookies("User")("Pword") = Request.Form("txtpassword");

Response.Redirect("chapt8default2.asp")

Response.End

}
%>

Microsoft JScript runtime error '800a01b6'

Object doesn't support this property or method

/aspchapt8/auth.asp, line 47 (this is line
47 -Response.Cookies("User").expires = ExpireDate.toLocaleString();
-)

----------------------------------------------------------------------------
-
Thanks in Advance for any help given

--

/ Sean the Mc /
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
Jul 19 '05 #1
6 3614
Have you tried using a standard date instead of a proprietary getLocale()
date? This worked fine for me:

<script language=jscript runat=server>

var ed = new Date();
var dStr = getISOdate(ed);

Response.Write(dStr);
Response.Cookies("User")("UName") = "blah";
Response.Cookies("User").Expires = dStr;

function getISOdate(d)
{
var dStr = d.getFullYear() + '-'
dStr += (ed.getMonth()<9) ? '0' : '';
dStr += (ed.getMonth()+1) + '-';
dStr += (ed.getDate()<10) ? '0' : '';
dStr += (ed.getDate());
return dStr;
}

</script>

--
http://www.aspfaq.com/
(Reverse address to reply.)


"What-a-Tool" <Di************************@IHateSpam.Net> wrote in message
news:oO4Ec.6454$mN3.4511@lakeread06...
I'm going out out of my mind trying to get this to work with no luck. The
error message I get is at the bottom. Can someone please tell me what I'm
doing wrong here. I've tried this a million different ways and can't get it to work. I can get it to work with VBScript, but I need to do this project
in JavaScript. HELP- PLEASE!?

<%@Language=JavaScript%>
<%Response.buffer=true%>

<%
if(Request.Form("txtusername") == "" || (Request.Form("txtpassword") == "")) {
%>

<HTML>
<HEAD>
<meta http-equiv="Content-Language" content="en-us">
<title>Error Information</title>
</HEAD>
<BODY>

<Some HTML text Here>
<%
}
else
{

ExpireDate = new Date();
ExpireDate.setYear = (ExpireDate.getYear() + 1);

Response.Cookies("User").expires = ExpireDate.toLocaleString();

Response.Cookies("User")("UName") = Request.Form("txtusername");
Response.Cookies("User")("Pword") = Request.Form("txtpassword");

Response.Redirect("chapt8default2.asp")

Response.End

}
%>

Microsoft JScript runtime error '800a01b6'

Object doesn't support this property or method

/aspchapt8/auth.asp, line 47 (this is line
47 -Response.Cookies("User").expires = ExpireDate.toLocaleString();
-)

-------------------------------------------------------------------------- -- -
Thanks in Advance for any help given

--

/ Sean the Mc /
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

Jul 19 '05 #2
What-a-Tool wrote:
I'm going out out of my mind trying to get this to work with no luck.
The error message I get is at the bottom. Can someone please tell me
what I'm doing wrong here. I've tried this a million different ways
and can't get it to work. I can get it to work with VBScript, but I
need to do this project in JavaScript. HELP- PLEASE!? <snip>
Microsoft JScript runtime error '800a01b6'

Object doesn't support this property or method

/aspchapt8/auth.asp, line 47 (this is line
47 -Response.Cookies("User").expires = ExpireDate.toLocaleString();
-)


JScript, as opposed to VBScript, is case-sensitive. You are going to need
keep a link to the online documentation handy so you can verify which
letters need to be capitalized. This is the starting point:
http://msdn.microsoft.com/library/en..._web_pages.asp

Let's look at the line causing the error:
Response.Cookies("User").expires = ExpireDate.toLocaleString();
Follow the Built-in Objects link get to the page from which you can follow
the Response Object link to finally reach here:
http://msdn.microsoft.com/library/en..._resoccook.asp

You will see that "expires" needs to be "Expires"

HTH,
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #3
> You will see that "expires" needs to be "Expires"

I meant to note that it was the first piece of the code that I changed, but
on my machine at least, expires and Expires seemed to perform equally well.

What fixed the problem for me (though I was getting Type Mismatch) was using
a sensible date format.

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 19 '05 #4
Aaron [SQL Server MVP] wrote:
You will see that "expires" needs to be "Expires"


I meant to note that it was the first piece of the code that I
changed, but on my machine at least, expires and Expires seemed to
perform equally well.

That is a surprise. I wonder why? Could it be creating a new attribute with
the value supplied?

Bob
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #5
> That is a surprise. I wonder why? Could it be creating a new attribute
with
the value supplied?


Maybe it's just passing the attribute to the client, and not trying to
actually "implement" it within the JavaScript code...

Though, when I tried Response.Cookies("User").blat = something I got the
aforementioned 800a01b6 error.

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 19 '05 #6
HELP- PLEASE!?
Microsoft JScript runtime error '800a01b6'

Object doesn't support this property or method

/aspchapt8/auth.asp, line 47 (this is line
47 -Response.Cookies("User").expires = ExpireDate.toLocaleString();
-)


Just want to say thanks.
I got it working by re-formatting my date string as suggested, and now it
works as advertised by my text book.
Thanks for taking the time!

Sean
Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: newbie_mw | last post by:
Hi, I need urgent help with a novice problem. I would appreciate any advice, suggestions... Thanks a lot in advance! Here it is: I created a sign-up sheet (reg.html) where people fill in their...
2
by: HolaGoogle | last post by:
Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have to field.One is a "yes/no" field and another one is "number" field. To display the yes/no field...
5
by: TrvlOrm | last post by:
HI There, I have been struggling with JavaScript code for days now, and this is my last resort! Please help... I am trying to create a JavaScript slide show with links for Next Slide,...
2
by: clinttoris | last post by:
Hello, If someone could help me it would be appreciated as I am not having much luck. I'm struggling with my asp code and have some questions relating to asp and oracle database. First...
3
by: aking | last post by:
Dear Python people, im a newbie to python and here...so hello! Im trying to iterate through values in a dictionary so i can find the closest value and then extract the key for that...
32
by: Tom Cole | last post by:
I bet 50% of the posts I've read lately have had at least one bad thing to say about every website or book dedicated to javascript. There are clearly a few posters (you know who you are) who...
15
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to...
6
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.