How to reference a function from the ASPX page

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?
 
G

grava

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
 
B

bruce barker

you need to fully qualify the function name.

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

-- bruce (sqlwork.com)
 
L

Larry Bud

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,811
Messages
2,569,693
Members
45,478
Latest member
dontilydondon

Latest Threads

Top