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 to deal with different permissions for Administrator and Limited User
Windows Command line popup alerts
Problems with ActiveX message and disappearing logo in Outlook Signatures
Reformatted PC needs drivers
Outlook 2003 calendar invitations get bounce back
formatting a file on UNIX to add Header and Footer (using html )
ASA5505 IMAP4 Configuration RE:IPHONE
E-FAIL Status error on ADP - Access/SQL
n-Tier Architecture
Printer auto-creation failure. Reason: AddPrinter() failed with status 0x5