user1429322
user1429322

Reputation: 1286

VBScript to VB error

I have been rewriting some of my old VBscript code to VB code.I am almost done with everything but I get an error at one place.

VB Script

Session("FirstName") = Request.Cookies("FirstName").Item

VB

Session.Add("FirstName", Request.Cookies("FirstName").Item)

and the error is

BC30455: Argument not specified for parameter 'key' of 'Public Default Property Item(key As String) As String'.

Can anybody tell me how to correct this error or atleast what does the error mean? Thanks in advance.

Upvotes: 2

Views: 165

Answers (1)

Scott Selby
Scott Selby

Reputation: 9570

    Session.Add("FirstName", Request.Cookies("FirstName"))

should work , when you use .Item it is expecting a key for Item such as:

Session.Add("FirstName", Request.Cookies("FirstName").Item("ItemKey"))

Upvotes: 5

Related Questions