access const in different class from aspx page
How can I access a const in a module from an aspx page?
I use this to access const in the code behind:
<%=MY_CONST%>
What is the difference when the Const is in a different class (a module in
the project)?
First edit: So I tried the solutions "use <%= Myclass.Myconst %>" but I
got the error "Name Myclass is not declared".
Here is more details: The class is in the same project. It is a module
wich contains multiple Const. I use VB.net .NET 3.5
any ideas?
Solution:
I found the solution here :
I need to add an import statement:
<%@ Import Namespace="Mynamespace.Myclass" %>
and then I can use:
<%=MyConst%>
No comments:
Post a Comment