Global.asa and including custom asp class?

Discussion in 'ASP General' started by dennis.eklund@harnosand.office.se, May 21, 2004.

  1. Guest

    Hi...

    I have a question that about global.asa and including a custom made class.
    Wonder if it's possible and if so, how?

    What I want is to set up my class global for the site, I made a asp file
    called cls_utils.asp
    and currently calling the <!-- include #file--> command in the default web
    page,
    and then Set util = MyUtils.
    It would be nice to have this in the global.asa file instead of creating and
    destroying the object all the time.
    Is it possible to make a global object within global.asa with a custom class
    file?
    Hope this make sense =)

    /Dennis
    (running iis5)

    example:
    ----global.asa------
    <object runat="server" scope="session" id="util" ...dont know the rest
    (classes/cls_utils.asp?).....>
    --------------------

    ----cls_utils.asp----
    Class MyUtils
    public function SomeThing(strText)
    something = strText
    end function
    End Class
    --------------------

    ----default.asp-----
    <html>
    .....
    ....
    <% = util.something("Does this work?") %>
    --------------------
     
    , May 21, 2004
    #1
    1. Advertising

  2. dlbjr Guest

    Personally, I would open and close per page as needed.


    'from dlbjr

    'Unambit from meager knowledge of inane others,engender uncharted sagacity.
     
    dlbjr, May 21, 2004
    #2
    1. Advertising

  3. Guest

    Thanks for your reply, but it didnt help me much =)

    What are the adventages/disadventages for the different models?
    My current layout is one default.asp page, from there I use serverside
    include for
    different pages, this means that for every page link a user press the
    default.asp page will run.
    This makes my classes to be created and destroyed every time the page is
    refreshed.
    Would still like to know if it's possible to create theese classes from
    global.asa.

    // Dennis


    "dlbjr" <> skrev i meddelandet
    news:...
    > Personally, I would open and close per page as needed.
    >
    >
    > 'from dlbjr
    >
    > 'Unambit from meager knowledge of inane others,engender uncharted

    sagacity.
    >
    >
     
    , May 24, 2004
    #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. Wayne
    Replies:
    2
    Views:
    493
    Wayne
    Nov 11, 2003
  2. yuridia

    Problem loading ASP and global.asa in IIS 5.0

    yuridia, Oct 13, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    112
    yuridia
    Oct 13, 2004
  3. Tom Bates
    Replies:
    0
    Views:
    167
    Tom Bates
    Sep 8, 2003
  4. Grant Schenck
    Replies:
    5
    Views:
    403
    Grant Schenck
    Apr 14, 2005
  5. Noozer
    Replies:
    3
    Views:
    427
    Noozer
    Jul 19, 2005
Loading...

Share This Page