Microsoft
Software
Hardware
Network
Question : Write a cookie
I'm using an ASP Ajax star rating script on my web pages. When the user clicks on a star it inserts that rating into my db and then hides star rating for that products uniqueID. But if the user hits refresh they can vote again on the same product. When I was going through the limited documentation that came with the script I couldn't figure out how they were writing the cookie.
Here is some of what I'm using:
<%
Dim strLinknum
strLinknum = rsLink("LINK_ID")
%>
<%
If Request.Cookies("RateSong"
)("Song" & strLinknum) = "True" Then
%>
<%else%>
D").Value)
%>">
D").Value)
%>" class="cgr">Vote on this video
NK_ID").Va
lue)%>').i
nnerHTML='
Poor - 1 star'" onmouseout="document.getEl
ementById(
'ra<%=(rsL
ink.Fields
.Item("LIN
K_ID").Val
ue)%>').in
nerHTML='V
ote this link'" title="Poor - 1 star" class="onestar" onClick="sndRating('<%=(rs
Link.Field
s.Item("LI
NK_ID").Va
lue)%>','1
');return false">1
NK_ID").Va
lue)%>').i
nnerHTML='
Fair - 2 stars'" onMouseOut="document.getEl
ementById(
'ra<%=(rsL
ink.Fields
.Item("LIN
K_ID").Val
ue)%>').in
nerHTML='V
ote this link'" title="Fair - 2 stars" class="twostars" onClick="sndRating('<%=(rs
Link.Field
s.Item("LI
NK_ID").Va
lue)%>','2
');return false">2
NK_ID").Va
lue)%>').i
nnerHTML='
Interestin
g - 3 stars'" onMouseOut="document.getEl
ementById(
'ra<%=(rsL
ink.Fields
.Item("LIN
K_ID").Val
ue)%>').in
nerHTML='V
ote this link'" title="Interesting - 3 stars" class="threestars" onClick="sndRating('<%=(rs
Link.Field
s.Item("LI
NK_ID").Va
lue)%>','3
');return false">3
NK_ID").Va
lue)%>').i
nnerHTML='
Good - 4 stars'" onMouseOut="document.getEl
ementById(
'ra<%=(rsL
ink.Fields
.Item("LIN
K_ID").Val
ue)%>').in
nerHTML='V
ote this link'" title="Good - 4 stars" class="fourstars" onClick="sndRating('<%=(rs
Link.Field
s.Item("LI
NK_ID").Va
lue)%>','4
');return false">4
NK_ID").Va
lue)%>').i
nnerHTML='
Excellent - 5 stars'" onMouseOut="document.getEl
ementById(
'ra<%=(rsL
ink.Fields
.Item("LIN
K_ID").Val
ue)%>').in
nerHTML='V
ote this link'" title="Excellent - 5 stars" class="fivestars" onClick="sndRating('<%=(rs
Link.Field
s.Item("LI
NK_ID").Va
lue)%>','5
');return false">5
<%End if%>
I did do a simple test to see I could actually keep the rating hidden by place a cookie on the page from the get go and it worked:
<%
Dim strLinknum
strLinknum = rsLink("LINK_ID")
%>
<% Response.Cookies("RateSong
")("Song" & strLinknum) = "True" %>
Answer : Write a cookie
There are NO cookies set in the code you showed
Random Solutions
How can I add leading and following zero's to a floating point number?
How to set computer name and join a domain before or after ghost image with sysprep?
VB: Add BLOB to MySQL (datset)
good features about python
PHP won't work
EXPLORER caused a general protection fault
Convert SQL datetime from UTC to local
ActiveX Error 336
Copying mdb files through a VPN using RDP
SQLSRV32.DLL Version 3.60.0319 Error: client unable to establish connection