Property Item is 'ReadOnly'

Discussion in 'ASP.NET / ASP.NET Core' started by lionheart, Mar 19, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. What is meant by Property 'Item' is 'ReadOnly'.

    Dim vRemote
    Response.Cookies("vRemote") = Request.ServerVariables("REMOTE_ADDR")

    According to SDK HELP file ...
    If the variable is a read-only variable, the assignment must take place in a Shared or instance constructor appropriate for the type of the variable; otherwise a compile-time error occurs.

    Can anyone show how to do this?
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    This means that you cannot assign value to the property.

    Response.cookie allows your to retrieve a cookie.

    I am not sure what you are trying to do, so I can't recommend any solution. What is that you are trying to achieve.?



    quote:Originally posted by lionheart


    What is meant by Property 'Item' is 'ReadOnly'.

    Dim vRemote
    Response.Cookies("vRemote") = Request.ServerVariables("REMOTE_ADDR")

    According to SDK HELP file ...
    If the variable is a read-only variable, the assignment must take place in a Shared or instance constructor appropriate for the type of the variable; otherwise a compile-time error occurs.

    Can anyone show how to do this?

    </blockquote id="quote"></font id="quote">
     
  3. I have a default.aspx where it is consists of several 'include files'. (Actually I am upgrading my current ASP files to .NET.)Everytime a user click a link on this page(DEFAULT.ASPX), it will load the same page, however as this page is loaded it will now decide as to what 'included file' be displayed depending on the value of a QueryString returned. As to the code below

    Dim vRemote
    Response.Cookies("vRemote") = Request.ServerVariables("REMOTE_ADDR")


    The purpose of this is simply to store the IP address of the user to a cookie called "vRemote" and which at a later time would be used to determine if the same IP (or user) is loading the page. If so, then I will not increment my counter.

    Thanks.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page