S
SStory
I made an ascx control
States.
It just has a dropdown combo with a list of state abbrevs.
I dropped it on a webform then in the code behind file I want to get access
to the value that was selected.
Inside of the code file of the states control I have a property
Public ReadOnly Property SelectedItemText() As String
Get
Return dropState.SelectedItem.Text
End Get
End Property
When the control was dropped on the webform it was given the id StateNewLoc
But in the code behind Vb file I can't access any properties by that
name--it won't come up in intellisence.
So I declared a protected variable
Protected StatesAddLoc As States
But StatesAddLoc.SelectedItemText always gives me an error of
nullreference--it is not set to anything.
That makes sense since the name is different from the ID but I don't know
how do I get access to the control on the webform from within the vb code
behind file.
Thanks,
Shane
States.
It just has a dropdown combo with a list of state abbrevs.
I dropped it on a webform then in the code behind file I want to get access
to the value that was selected.
Inside of the code file of the states control I have a property
Public ReadOnly Property SelectedItemText() As String
Get
Return dropState.SelectedItem.Text
End Get
End Property
When the control was dropped on the webform it was given the id StateNewLoc
But in the code behind Vb file I can't access any properties by that
name--it won't come up in intellisence.
So I declared a protected variable
Protected StatesAddLoc As States
But StatesAddLoc.SelectedItemText always gives me an error of
nullreference--it is not set to anything.
That makes sense since the name is different from the ID but I don't know
how do I get access to the control on the webform from within the vb code
behind file.
Thanks,
Shane