The variable is not declared to be unavailable due to its level of protection.

My VB skills are not the best, and this problem made me stagnate for several days.

In the list of controls displayed in Visual Studio that are not defined in the code behind, I can “hover over” them and a tooltip will appear up.

popup

errors

screenshot

Related questions:

This had no solution - 'var_name' was not declared. It may not be available due to its level of protection. in debug mode

This suggests that the solution was in web.config, but I do not understand where / how is BC30451: "MailValidation" is not declared. It may not be available due to its level of protection.

This is one error word - vb.net error: not available due to protection level

Updating is another issue that may be the key to my problems:

In my Tools.vb module, I have a class for accessing LDAP.

The namespace for the tools class is specified in the login.aspx.vb code, but the login code does not recognize the tools class.

missing tools

+7
visual-studio-2010
source share
5 answers

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.

+4
source share

I had a similar problem: Sub is not available at runtime, but absolutely finished in the editor. It was resolved by changing the destination platform from 4.5.1 to 4.5. It seems that my IIS only had version 4.5.

:)

+3
source share

If I remember correctly, this is the default property for controls.

Can you try logging into the Design-View for admin_reasons, which contains the specified control, and then change the Modifiers Control property to Public or Internal.

+2
source share

I had a similar problem. I decided that all the projects within my solution are aimed at the same .NET Framework 4 client profile, and then at restoring the entire solution.

+2
source share

I got this error not long after renaming the App_Code folder. In fact, I accidentally dragged the entire folder to the App_data folder. VS 2015 did not complain that it was difficult to determine what went wrong.

+1
source share

All Articles