Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Functions in a module on ASPX pages 1

Status
Not open for further replies.

vpekulas

Programmer
Jan 8, 2002
154
CA
I have a module where I keep all my common functions, now I want to use one of the functions like this in the page.aspx file:

<td align="Center"><%#CONVERT_TXT(Container.DataItem("fldACTIVE"))%></td>

The function CONVERT_TXT is decalred pulic in the module.

When I put the function in the code-behind of the page it works perfectly well, but when I keep the function in the module (which is public as well) it says that

Name 'CONVERT_TXT' is not declared.

Why is that ? Thanks you !

&quot;Taxes are the fees we pay for civilized society&quot; G.W.
 
You need to fully qualify your reference. For example:

MyProjectName.MyAssemblyName.CONVERT_TXT(....

-p

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Thanks link9, worked like a charm :)
Do you know how I can import it so I can use only the function name rather then the whole reference
project.module.function ......
I'm using VS.NEt 2002

&quot;Taxes are the fees we pay for civilized society&quot; G.W.
 
Just like a using or Imports statement w/ a twist:

<%@ Import Namespace="MyProjectName.MyAssemblyName" %>

:)
paul

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
This would be per page setting though, is there a way to that for the entire project wihtout having to import the namespace for each page ?

&quot;Taxes are the fees we pay for civilized society&quot; G.W.
 
Compile the utility module in the root namespace.

-p

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Is there a way to do it on a project by project basis instead of just root. And not doing it on each page? I usually have one for each project to do things with .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top