I have a module written in VB.Net that has several read-only properties. It looks like this:
Module Name1
Public ReadOnly Property ClientID As String
Get
Return "[some data here]"
End Get
End Property
Public ReadOnly Property ClientKey As String
Get
Return "[some data here]"
End Get
End Property
End Module
Nothing real fancy here. What I'm trying to do is use this module in an MVC 5 Razor page like this:
<span>@Name1.ClientID - @Name1.ClientKey</span>
Again, nothing fancy. But running the code produces the following error:
Name1 is not accessible in this context because it is 'Friend'.
Modules have friend access by default, which prevents them from being accessible outside of the current assembly. This is what I want. But it doesn't work when called from a Razor page. I've check to ensure that the namespaces were imported and such but no go. (Changing the module's access to public gets things working but I don't wish to make it public.)
What am I doing wrong?