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 :)

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.