I can access a module from code behind but not from the aspx page in inline VB code <% ... %>.
I know its got to be something simple but I can't seem to find the answer anywhere.
I can access a module from code behind but not from the aspx page in inline VB code <% ... %>.
I know its got to be something simple but I can't seem to find the answer anywhere.
I find you can also use an Imports Directive as follows at the top of the page:
< % @ Import Namespace="BHSAA.Module1" % >
Where BHSAA was the name of my web app Project and Module1 was , of course my Module with Functions I wanted to call in Code Blocks on my ASPX page.
Your Module and the Functions or Subs in it apparently have to be Public.
Hope that works for you, too.
If you want to run a static method from your
aspx
you can do something like this:<% MyNamespace.MyClass.MyMethod() %>
If you want to instancate an object and call a method on that you can do that as well: