Carisle
Carisle

Reputation: 467

Identifier expected and Property access must assign property or use its value errors

Using the following code I get Identifier expected and Property access must assign property or use its value errors:

ViewState["SomeKeyValue"] What is wrong with this code?

Upvotes: 0

Views: 1690

Answers (2)

ipr101
ipr101

Reputation: 24236

I think ViewState["SomeKeyValue"] should be ViewState("SomeKeyValue")

Square brackets would be used for c# vb uses ().

Upvotes: 2

SLaks
SLaks

Reputation: 887449

VB.Net uses () instead of [] for indexers:

ViewState("SomeKey") = ...

Upvotes: 2

Related Questions