Note the first part of the error: "variable not declared"
Ignore the second part: "it may not be available due to the level of protection." This is red herring.
Some questions ... (the answers may be in the image that you posted, but I can’t seem to have it anymore, and my eyes don’t read this small print ... Any chance you can publish the code how these elderly eyes can Read it? It's hard for me to know the big picture. In particular, I am suspicious of your pages.)
We know 1stReasonTypes is a list, but for some reason it seems like we don't know the WHICH listbox. That is why I want to see your directives on the page.
But also, how do you call the private FormRefresh () method? This is not an event handler that makes me wonder if you are trying to link to a list in a form that is not being processed properly in this code.
You may need to find 1stReasonTypes controls. Try to put your list in something like
<div id="MyFormDiv" runat="server">.....</div>
then in FormRefresh (), do a ...
Dim 1stReasonTypesNew As listbox = MyFormDiv.FindControl("1stReasonTypes")
Or use an existing control, object or page instead of a div. Additional information about FindControl: http://msdn.microsoft.com/en-us/library/486wc64h(v=vs.110).aspx
But no matter how you cut it, there is something scared here, so 1stReasonTypes does not know which list it should be.
Casey crookston
source share