How can I call module function in ASPX markup?

oscilatingcretin

I have a VB.NET WebForms app and am trying to use inline server tags in the markup to call a function that's located in a module. No matter what I do, I cannot get intellisense to show the method when I use <%= %> or <%# %> tags. Here's my module:

Module TestModule

    Function test() As String

        Return String.Empty

    End Function

End Module

However, when I convert the module into a class and convert the methods into shared methods, I can do this:

Public Class TestClass

    Shared Function test() As String

        Return String.Empty

    End Function

End Class

I can place this within my form:

<%= MyApp.TestClass.test%>

I can use this in control binding:

<asp:Button ID="cmWhatever" Text='<%#MyApp.TestClass.test%>' runat="server" />

How can I reference module methods from the markup?

Prasanth

'Use this instead:

    Public Module TestModule
        Public Function test() As String
          Return String.Empty
        End Function
    End Module

'More over you have to use <%@ Import Namespace="Your root namespace" %> on the start of the aspx page

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I call function?

From Dev

Can I spy with sinon a function call in an external module function?

From Dev

How can I call a function inside of a function?

From Dev

How can I call a module function inside Enum.map without getting an "Undefined reference" error?

From Dev

How can I call functions from module patterns from an event function

From Dev

How can I call a function defined inside a module of requirejs from my page?

From Dev

How can I call a function from inside an imported module, aka design issue

From Dev

APScheduler callback function - how can I call some funtion/module in python when a job is completed?

From Dev

How can I find the function of a python module?

From Dev

How can I call function with different combinations

From Dev

How can I call the function of Report in VBA?

From Dev

How can I call a function within a website?

From Dev

How can I call a function inside a class?

From Dev

How can I call function in PHP

From Dev

How can I apply a function call to an alias?

From Dev

How can I call a function in a php class?

From Dev

How Can I Call a Function Properly?

From Dev

How can I succesfully call the execv function?

From Dev

How can I call function with parameter in bash?

From Dev

How can I call a function in an angular controller?

From Dev

How can I call this function in haskell?

From Dev

How can i call a javascript function

From Dev

How can I generate dynamic React markup

From Dev

How do I call a module function in Powershell Start-job

From Dev

How can i use ternary if in aspx page?

From Dev

How can I call the class slibing function in javascript anonymous function

From Dev

How can I call AngularJS function in JS function

From Dev

how can i call function inside another function.?

From Dev

How can I call click function to another click function in jQuery

Related Related

  1. 1

    How can I call function?

  2. 2

    Can I spy with sinon a function call in an external module function?

  3. 3

    How can I call a function inside of a function?

  4. 4

    How can I call a module function inside Enum.map without getting an "Undefined reference" error?

  5. 5

    How can I call functions from module patterns from an event function

  6. 6

    How can I call a function defined inside a module of requirejs from my page?

  7. 7

    How can I call a function from inside an imported module, aka design issue

  8. 8

    APScheduler callback function - how can I call some funtion/module in python when a job is completed?

  9. 9

    How can I find the function of a python module?

  10. 10

    How can I call function with different combinations

  11. 11

    How can I call the function of Report in VBA?

  12. 12

    How can I call a function within a website?

  13. 13

    How can I call a function inside a class?

  14. 14

    How can I call function in PHP

  15. 15

    How can I apply a function call to an alias?

  16. 16

    How can I call a function in a php class?

  17. 17

    How Can I Call a Function Properly?

  18. 18

    How can I succesfully call the execv function?

  19. 19

    How can I call function with parameter in bash?

  20. 20

    How can I call a function in an angular controller?

  21. 21

    How can I call this function in haskell?

  22. 22

    How can i call a javascript function

  23. 23

    How can I generate dynamic React markup

  24. 24

    How do I call a module function in Powershell Start-job

  25. 25

    How can i use ternary if in aspx page?

  26. 26

    How can I call the class slibing function in javascript anonymous function

  27. 27

    How can I call AngularJS function in JS function

  28. 28

    how can i call function inside another function.?

  29. 29

    How can I call click function to another click function in jQuery

HotTag

Archive