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
URL Appear on Google and Yahoo - Top 10
How do I link an External Exchange Server to an Internal Exchange server to share calendar info
RAS batch file
Backup Exec Crashing Jobs
how to convert char(14) field to dd/mm/yyyy hh:mm:ss
Citrix Connection from Workstation Issue
Report tally of 30 questions 1-5 answers
acrobat SDK
dump and load in sybase
SciTE abbreviation for Ruby