0

dim num, GOPercent

num = Request.Cookies("Result")

GOPercent = num/25 Type mismatch: '[string: ""]'

Error Type mismatch. But the value i put in Response.cookies("Result") is a CInt(value)

how to solve this ?????

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by k_en
0

I'm not sure if you're saying the value you get from num = Request.Cookies("Result") is blank or just that it is a mismatch.

First of all do the following to your code

num = Request.Cookies("Result")

If num <> "" Then

    GOPercent = cInt(num)/25

End If

If you are saying you get no value back then check two things

1. You are definately setting Response("Result") to a value

2. Cookies are enabled on the client browser

You are going to need a lot more durable code to run this kind of thing so look in to how to preempt errors and handle issues. This isn't as easy in vbscript as it is in other languages, but there's always a way :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.