sorry: and now with subject: how to reuse function in any page of application?

Discussion in 'ASP .Net' started by michel, Feb 18, 2007.

  1. michel

    michel Guest

    Hi,

    i defined a function (no matter what it does) in code-behind of an aspx page
    like this:

    Public Function myfunction(ByVal x As Object) As String
    Dim tmp As String = x.ToString()
    .......
    Return tmp
    End Function

    Now i would like to use that function in any aspx pages of my asp.net
    application.
    How can i do that?

    Thanks
    Michel
     
    michel, Feb 18, 2007
    #1
    1. Advertising

  2. michel

    Patrick Guest

    You can create a new class which will be added to the App_Code directory

    Check out
    http://dotnetjunkies.com/QuickStartv20/aspnet/doc/pages/code.aspx

    "michel" <mm@mmm> wrote in message
    news:...
    > Hi,
    >
    > i defined a function (no matter what it does) in code-behind of an aspx
    > page
    > like this:
    >
    > Public Function myfunction(ByVal x As Object) As String
    > Dim tmp As String = x.ToString()
    > .......
    > Return tmp
    > End Function
    >
    > Now i would like to use that function in any aspx pages of my asp.net
    > application.
    > How can i do that?
    >
    > Thanks
    > Michel
    >
    >
    >
     
    Patrick, Feb 18, 2007
    #2
    1. Advertising

  3. michel

    michel Guest

    Thanks

    "Patrick" <> schreef in bericht
    news:u$...
    > You can create a new class which will be added to the App_Code directory
    >
    > Check out
    > http://dotnetjunkies.com/QuickStartv20/aspnet/doc/pages/code.aspx
    >
    > "michel" <mm@mmm> wrote in message
    > news:...
    >> Hi,
    >>
    >> i defined a function (no matter what it does) in code-behind of an aspx
    >> page
    >> like this:
    >>
    >> Public Function myfunction(ByVal x As Object) As String
    >> Dim tmp As String = x.ToString()
    >> .......
    >> Return tmp
    >> End Function
    >>
    >> Now i would like to use that function in any aspx pages of my asp.net
    >> application.
    >> How can i do that?
    >>
    >> Thanks
    >> Michel
    >>
    >>
    >>

    >
    >
     
    michel, Feb 18, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad
    Replies:
    5
    Views:
    549
    Steve C. Orr [MVP, MCSD]
    May 17, 2005
  2. Hylander

    To reuse or not to reuse....

    Hylander, Feb 26, 2004, in forum: Java
    Replies:
    0
    Views:
    427
    Hylander
    Feb 26, 2004
  3. code reuse and design reuse

    , Feb 7, 2006, in forum: C Programming
    Replies:
    16
    Views:
    1,040
    Malcolm
    Feb 12, 2006
  4. Stephen Kershaw
    Replies:
    4
    Views:
    271
    Martin Ambuhl
    Mar 25, 2006
  5. jacob navia

    To reuse or not to reuse

    jacob navia, Nov 5, 2006, in forum: C Programming
    Replies:
    19
    Views:
    545
    Dave Thompson
    Dec 18, 2006
Loading...

Share This Page