How to reference a function from the ASPX page

  • Thread starter Thread starter Larry Bud
  • Start date Start date
L

Larry Bud

Let's say I have a text box

<asp:TextBox ID="OutputVariableTextBox" runat="server"
OnPreRender="RunThisFunction" >

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?
 
Larry Bud said:
Let's say I have a text box

<asp:TextBox ID="OutputVariableTextBox" runat="server"
OnPreRender="RunThisFunction" >

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
 
you need to fully qualify the function name.

<namespace>.<module name>.<function name>

-- bruce (sqlwork.com)
 
you need to fully qualify the function name.

<namespace>.<module 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?
 
Back
Top