473,392 Members | 1,341 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,392 software developers and data experts.

ASP Different Results In Firefox And IE !

Hi,

I have following code, picking an ID and saving it to Cookies.

<%
ItemID = Request("prod")
Response.Cookies("THREES")(ItemID) = Request("prod")
Set rdset=objConn.Execute("SELECT ID, Name, Large, Description
FROM shop_products WHERE ID=" & ItemID)
%>

In IE it works fine as it should, adding item id to Cookies

In Firefox it gives me the following error:
Cookies object, ASP 0102 (0x80004005)
The function expects a string as input.
/shop/addcart.asp, line 27

Any information on that. Any idea what is going wrong.

Best Wishes
Lovely

Jul 31 '06 #1
4 4520
As I was using form to send "prod" to next page, using hidden element
in form on previous page.

I update the code as :

<%
ItemID = Request.form("prod")
Response.Cookies("THREES")(ItemID) = Request.form("prod")
Set rdset=objConn.Execute("SELECT ID, Name, Large, Description
FROM shop_products WHERE ID=" & ItemID)
%>

It work in IE, stil doesnt work in FireFox.

Any ideas.

Best Wishes
Lovely

Jul 31 '06 #2
Changed it to:

<%
ItemID = Cstr(Request.form("prod"))
Response.Cookies("THREES")(ItemID) = Request.form("prod")
Set rdset=objConn.Execute("SELECT ID, Name, Large, Description
FROM shop_products WHERE ID=" & Request.form("prod"))
%>

Still in IE its working as it should be, in FireFox, it is not giving
error:

Cookies object, ASP 0183 (0x80004005)
A cookie with an empty key cannot be stored.
/shop/addcart.asp, line 2

Any ideas.

Best Wishes
Lovely

Jul 31 '06 #3
You seem to be storing the cookie with the same value for the cookies key as
well as its value as ItemID = Cstr(Request.form("prod"))

is this what you wanted to do?

either way,

response.write ItemID

to see if in fact it does hold a string key

<lo******************@yahoo.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Changed it to:

<%
ItemID = Cstr(Request.form("prod"))
Response.Cookies("THREES")(ItemID) = Request.form("prod")
Set rdset=objConn.Execute("SELECT ID, Name, Large, Description
FROM shop_products WHERE ID=" & Request.form("prod"))
%>

Still in IE its working as it should be, in FireFox, it is not giving
error:

Cookies object, ASP 0183 (0x80004005)
A cookie with an empty key cannot be stored.
/shop/addcart.asp, line 2

Any ideas.

Best Wishes
Lovely

Jul 31 '06 #4

Slim wrote:
You seem to be storing the cookie with the same value for the cookies key as
well as its value as ItemID = Cstr(Request.form("prod"))

is this what you wanted to do?

either way,

response.write ItemID

to see if in fact it does hold a string key
Ah, good old ASP and its variant data types.

I've just been playing around and I can reproduce the error thus:
Works : Response.Cookies("monkey")("1") = "badger"
Fails: Response.Cookies("monkey")(1) = "badger"

In which case it's because -- as the error implies -- your parameter
ItemID needs to be explicitly cast as a string, like this:

Response.Cookies("THREES")(CStr(ItemID)) = Request("prod")

CStr forces the variable to have an internal variable type of 'String',
which you can test using the TypeName() function.

http://www.w3schools.com/vbscript/func_typename.asp

Hope this helps.

Jul 31 '06 #5

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

Similar topics

2
by: robert.waters | last post by:
Hi, Why do firefox and IE6 render this differently? http://mikewaters.net/div1.htm The relevant divs are (in order that they appear in source): 1) float left; position relative; width 100px;...
17
by: pasdecrap | last post by:
The following code will produce similar results in IE6 and firefox 1.0.4 however the left margin in FF is 4 pixels and in IE it is 5. Can anyone see why this is happening? I can't seem to figure...
4
by: kinne | last post by:
The following code is supposed to reverse the date in "yyyy-mm-dd" format, but it produces different results in Firefox 1.0 and in Internet Explorer 6SP1. In Firefox, the result is correct...
8
by: Lian | last post by:
Hi all, It is a newbie's question about html tag "img". The attributes "title" and "alt" for "img" seems having the same function. So what is the main difference between them? Can i use them at...
3
by: Jukka K. Korpela | last post by:
Some time ago in this group, someone suggested that we should develop a "different" user style sheet to demonstrate what a user style sheet or a browser style sheet _could_ do. I guess the idea was...
53
by: Jonas Smithson | last post by:
In his book "CSS: The Definitive Guide" 2nd edition (pgs. 116-117), Eric Meyer has an interesting discussion about "font-size-adjust" that was evidently dropped in CSS 2.1 due to browser...
26
by: jcomputer | last post by:
Hi, I created a website for a company and they wanted it in asp.net and this is not my first time using asp.net but when i check the site in internet explorer there are no errors but in Firefox...
6
by: dmorand | last post by:
I'm having a little trouble with my ajax. I can see my results in IE, but not firefox. I'm assuming I'm missing some syntax somewhere. alert("Test " + results + testing); returns the values in...
16
by: LayneMitch | last post by:
Greetings everyone. I'm new to the webdevelopment game and I developed my first site that looks good in IE but crappy in Mozilla/Firefox. Any advice on making my site browser to browser...
1
by: Chris | last post by:
Ok, I am new to php and kinda self teaching myself but I haven't found anyone with this problem. I am creating a site to manage my movies basicly the site will add movies to a database and view, as...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.