Let's say I have a Constants
class defined in a .vb
file as such:
Public Const myConst As String = "myID"
And in my page.ascx
file I wish to do something like this:
...
<someControl ID="<%$ Constants.myConst %>" runat="server" />
...
This shields compilation errors all over the place.
I've attempted several combinations, including =
or #
instead of $
, but none seem to work.
Note that I've read and do not believe this to be a duplicate of this answer, nor other similars.
I don't think this is even possible since Visual Studio use the ID to create an instance of that object in the .vb file. I would question the purpose of this but if you really need to I would suggest to generate a dictionary.
And in the init
Usually it's the other way around where the web page tells the dll which id/instance to use.