R
Raterus
Hello,
Does anyone have any ideas how I can accomplish this using properties. I'm
trying to create a property, that acts like a structure. Basically I'm
trying to create a property that I could do this with.
myCompanyIndex = currentCompany.Index
myCompanyName = currentCompany.Value
"currentCompany" would be the property, Index is an integer, Value is a
string.
Here is some of what I've tried...(I'm trying to set a single session
variable in asp.net, but for people unfamiliar with asp.net,
Session("company") would be an object)
Protected Structure NameValue
Public Name As String
Public Value As Integer
End Structure
Protected Property currentCompany() As NameValue
Get
currentCompany = CType(Session("company"), NameValue)
End Get
Set(ByVal Value As NameValue)
Session("company") = Value
End Set
End Property
This looks like it may work, but in code when I try this I get the following
error.
currentPEO.value = 1
currentPEO.Name = "My Company Name"
I get the following error on both lines..."Expression is a value and
therefore cannot be the target of an assignment."
Any help?
--Michael
Does anyone have any ideas how I can accomplish this using properties. I'm
trying to create a property, that acts like a structure. Basically I'm
trying to create a property that I could do this with.
myCompanyIndex = currentCompany.Index
myCompanyName = currentCompany.Value
"currentCompany" would be the property, Index is an integer, Value is a
string.
Here is some of what I've tried...(I'm trying to set a single session
variable in asp.net, but for people unfamiliar with asp.net,
Session("company") would be an object)
Protected Structure NameValue
Public Name As String
Public Value As Integer
End Structure
Protected Property currentCompany() As NameValue
Get
currentCompany = CType(Session("company"), NameValue)
End Get
Set(ByVal Value As NameValue)
Session("company") = Value
End Set
End Property
This looks like it may work, but in code when I try this I get the following
error.
currentPEO.value = 1
currentPEO.Name = "My Company Name"
I get the following error on both lines..."Expression is a value and
therefore cannot be the target of an assignment."
Any help?
--Michael