Skip to main content
Inspiring
December 17, 2007
Question

Asp simple redirect code

  • December 17, 2007
  • 1 reply
  • 589 views
I have a simple "vote on video" page. I don´t want users to be able to vote on a video more than once. I put the ID of a video in a session variable once one votes. So now I want to redirect to another page if the session variable = the ID of a video.
I type it in words, but what is the code:

Redirect to page.asp if
Session("vote_id")=Request.QueryString("ID")

Thanks!
This topic has been closed for replies.

1 reply

Inspiring
December 17, 2007
wavesurfer wrote:
> I have a simple "vote on video" page. I don?t want users to be able to vote on
> a video more than once. I put the ID of a video in a session variable once one
> votes. So now I want to redirect to another page if the session variable = the
> ID of a video.
> I type it in words, but what is the code:
>
> Redirect to page.asp if
> Session("vote_id")=Request.QueryString("ID")
>
> Thanks!
>

<%
If Session("vote_id") = Request.QueryString("ID") Then
Response.Redirect("page.asp")
End if
%>
Inspiring
December 17, 2007
Thanks, that works fine.

However, I need to set the session variable after I do the check, but can´t really figure out how, if I do as follows my update function doesn´t work, any suggestions?

<%
If Session("vote_id") = Request.QueryString("ID") Then
Response.Redirect("page.asp")
End if
%>
<%
Session("vote_id")=Request.QueryString("ID")
%>