N
Nathan Sokalski
I have an array declared as follows:
Dim ButtonList() As NavButtonInfo
and a Class defined as follows:
Public Class NavButtonInfo
Public Shared name As String
Public Shared text As String
Public Shared URL As String
Public Shared parentname As String
Public Shared Sub SetButtonInfo(ByVal name As String, ByVal text As
String, ByVal URL As String, ByVal parentname As String)
NavButtonInfo.name = name
NavButtonInfo.text = text
NavButtonInfo.URL = URL
NavButtonInfo.parentname = parentname
End Sub
End Class
I am adding data to my array using the following code:
ButtonList(0).SetButtonInfo("homeindex", "Life With Nate", "/index.aspx",
Nothing)
When I build and run my application, I recieve an error that tells me the
following:
[NullReferenceException: Object reference not set to an instance of an
object.]
I think I must be doing something wrong or forgetting something when I add
data to the array, but I am not sure what. Can anyone tell me what I am
forgetting? Thanks.
Dim ButtonList() As NavButtonInfo
and a Class defined as follows:
Public Class NavButtonInfo
Public Shared name As String
Public Shared text As String
Public Shared URL As String
Public Shared parentname As String
Public Shared Sub SetButtonInfo(ByVal name As String, ByVal text As
String, ByVal URL As String, ByVal parentname As String)
NavButtonInfo.name = name
NavButtonInfo.text = text
NavButtonInfo.URL = URL
NavButtonInfo.parentname = parentname
End Sub
End Class
I am adding data to my array using the following code:
ButtonList(0).SetButtonInfo("homeindex", "Life With Nate", "/index.aspx",
Nothing)
When I build and run my application, I recieve an error that tells me the
following:
[NullReferenceException: Object reference not set to an instance of an
object.]
I think I must be doing something wrong or forgetting something when I add
data to the array, but I am not sure what. Can anyone tell me what I am
forgetting? Thanks.