I need to use some feature of VB.net that is Module for my Asp.net MVC project. But I found that C# can't handle Module like VB.net does. Please look at the following code.
VB.Net - Globalization Project
Public Module [Module Name]
Public Const WebsiteName As String = "[My Website Name]"
End Module
VB.Net - Asp.net MVC View Page
<%@ Import Namespace="[Globalization Project Namespace]" %>
<%= WebsiteName %>
C#.Net - Asp.net MVC View Page
<%@ Import Namespace="[Globalization Project Namespace]" %>
<%= WebsiteName // Error because C# doesn't understand this statement %>
<%= [Module Name].WebsiteName // It works fine. %>
I think C# see all modules like classes. So, I can't call it directly without giving Module name. Do you have any idea for solving this question?
PS.1 I know. Module isn't correct OOP. But It's short and powerful.
PS.2 I can use VB.net for Globalization project because all of source code will be generated by my custom macro. But I don't like to write source code in VB.net. So, I don't use VB.net as primary language of Asp.net MVC View Page or other project.
Thanks,