How to reference a function from the ASPX page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Larry Bud

    #1

    How to reference a function from the ASPX page

    Let's say I have a text box

    <asp:TextBox ID="OutputVaria bleTextBox" runat="server"
    OnPreRender="Ru nThisFunction" >

    The function RunThisFunction is in a common module (in a separate .vb
    file) and I want it to execute on a prerender.

    But when the page compiles, it doesn't find RunThisFunction . How can
    I reference it?
  • grava

    #2
    Re: How to reference a function from the ASPX page



    "Larry Bud" <larrybud2002@y ahoo.comwrote in message
    news:12488fde-b8b6-452d-9c19-4d3480ab8505@d7 0g2000hsb.googl egroups.com...
    Let's say I have a text box
    >
    <asp:TextBox ID="OutputVaria bleTextBox" runat="server"
    OnPreRender="Ru nThisFunction" >
    >
    The function RunThisFunction is in a common module (in a separate .vb
    file) and I want it to execute on a prerender.
    >
    But when the page compiles, it doesn't find RunThisFunction . How can
    I reference it?
    I think you have to wrap the method call in your code behind file ... even
    if the implementation is in another class

    on your code behind:

    protected void RunThisFunction (object sender, eventargs e)
    {
    // outer method call.
    }

    HTH

    --
    Gianluca Gravina


    Comment

    • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

      #3
      RE: How to reference a function from the ASPX page

      you need to fully qualify the function name.

      <namespace>.<mo dule name>.<function name>

      -- bruce (sqlwork.com)


      "Larry Bud" wrote:
      Let's say I have a text box
      >
      <asp:TextBox ID="OutputVaria bleTextBox" runat="server"
      OnPreRender="Ru nThisFunction" >
      >
      The function RunThisFunction is in a common module (in a separate .vb
      file) and I want it to execute on a prerender.
      >
      But when the page compiles, it doesn't find RunThisFunction . How can
      I reference it?
      >

      Comment

      • Larry Bud

        #4
        Re: How to reference a function from the ASPX page

        >
        >
        "Larry Bud" wrote:
        Let's say I have a text box
        >
        <asp:TextBox ID="OutputVaria bleTextBox" runat="server"
        OnPreRender="Ru nThisFunction" >
        >
        The function RunThisFunction is in a common module (in a separate .vb
        file) and I want it to execute on a prerender.
        >
        But when the page compiles, it doesn't find RunThisFunction .  How can
        I reference it?- Hide quoted text -
        On Jan 18, 11:53 am, bruce barker
        <brucebar...@di scussions.micro soft.comwrote:
        you need to fully qualify the function name.
        >
        <namespace>.<mo dule name>.<function name>
        How do I know what namespace it's in if I just have a separate .vb
        file that declares a module and a function?

        Comment

        Working...