0

I am currently running on a ASP.NET v2.5, and I am having a terrible time converting this ASP to .NET compatibility...

Any assistance would be greatly appreciated!!

<%
Dim scr, loc

If Request.Querystring("Check") = "" Then
    scr = Request.ServerVariables("SCRIPT_NAME")
    loc = instrRev(scr,"/")
    scr = mid(scr, loc+1, len(scr) - loc)
    response.cookies("enabled").value="1"
    Response.Redirect(scr & "?Check=True")
Else
    if request.cookies("enabled").value="1" then
        response.write("<div style=""font-weight: bold;"">Cookies are enabled!</div>")
    else
        response.write("<div style=""color: red;"">Cookies are NOT enabled!</div>")
    end if
End If
%>

Lulu :)

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by webmaven
0

try this, where whatever is the name of your cookie.

Dim aCookie As HttpCookie = Request.Cookies("whatever")
            Try
                strWhatever as String = Server.HtmlEncode(aCookie.Values("whatever"))
            Catch
                 response.write("<div style=""color: red;"">Cookies are NOT enabled!</div>")
            End Try

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

This topic has been dead for over six months. 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.