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(B yVal name As String, ByVal text As
String, ByVal URL As String, ByVal parentname As String)
NavButtonInfo.n ame = name
NavButtonInfo.t ext = text
NavButtonInfo.U RL = URL
NavButtonInfo.p arentname = parentname
End Sub
End Class
I am adding data to my array using the following code:
ButtonList(0).S etButtonInfo("h omeindex", "Life With Nate", "/index.aspx",
Nothing)
When I build and run my application, I recieve an error that tells me the
following:
[NullReferenceEx ception: 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.
--
Nathan Sokalski
njsokalski@hotm ail.com
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(B yVal name As String, ByVal text As
String, ByVal URL As String, ByVal parentname As String)
NavButtonInfo.n ame = name
NavButtonInfo.t ext = text
NavButtonInfo.U RL = URL
NavButtonInfo.p arentname = parentname
End Sub
End Class
I am adding data to my array using the following code:
ButtonList(0).S etButtonInfo("h omeindex", "Life With Nate", "/index.aspx",
Nothing)
When I build and run my application, I recieve an error that tells me the
following:
[NullReferenceEx ception: 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.
--
Nathan Sokalski
njsokalski@hotm ail.com
Comment