Re: Accessing functions defined in Global.asax

From: Ryan Walberg (generalpf_at_nospam.yahoo.com.nospam)
Date: 02/04/04


Date: Wed, 04 Feb 2004 08:50:05 -0600

Anjali Lourda wrote:

> Hi,
> I have defined a function in global.asax file. Could somebody please
> tell me how i am supposed to call that function from the other files
> of the same project.
> Global.asax
> public function getName() as String
> dim name as string
> name = "Abc"
> return name
> end function
>
>
> myfile01.aspx
> 'How do I call that function from this file. Am I supposed to import
> something?

You could call a function defined in global.asax but you would be *much*
better off creating a class with a static method and referencing the
method that way. This is the purpose of code-behind.

-- 
Ryan Walberg, B.Sc., MCSD, MCSD for .NET
generalpf@nospam.yahoo.com.nospam


Relevant Pages

  • Re: OO conventions
    ... subclass object (likely by passing a string to the constructor, e.g., ... Image.opendefined as a static method (wait...is that ...
    (comp.lang.python)
  • Re: Can i pass a SqlConnection object with opened connection to a method/function as a parameter?
    ... methods in your long concatenated string, ... DataTools.EscapeMask method (a static method, apparently), or the ... > connection and what you do with it when you get it ... >> the existed opened sqlconnection object to do it and pass the object to ...
    (microsoft.public.dotnet.framework)
  • Re: Java syntax extension proposal
    ... You can already reference a static method through an instance, but most sources I've read regard that as a bad practice. ... It allows a static method from one class be called on an instance variable of another class (Let's say String). ...
    (comp.lang.java.advocacy)
  • Re: Inheritable Static methods
    ... Any static method, ... classname to a string, without hardcoding a string. ... encapsulate it into the class itself, so that instead of having the ... the former encapsulates the conversion into the int type. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Element End Tag
    ... "Yan Leshinsky" wrote: ... >> private string WriteXml ... >> mcp, mcse, mcsd, mcad.net, mcsd.net ...
    (microsoft.public.dotnet.xml)