how can I access methods in another class?

Discussion in 'ASP .Net' started by Davids, Nov 6, 2004.

  1. Davids

    Davids Guest

    ok this is basic but it really puzzles me.
    I have an .aspx page and within it a user control (for example
    mycontrol.aspx and it's code file mycontrol.aspx.cs). In the code for my
    base page I declare a public calculator class with some simple functions.
    Now how can I access and use this class' methods from the user control code,
    the compiler keeps saying "The type or namespace name 'Calculator' could not
    be found "

    PS I'm not using dll files just Src="" attributes in the directives
    Davids, Nov 6, 2004
    #1
    1. Advertising

  2. Davids

    Eric Renken Guest

    You want a user control to be able to use a class on your page? I would
    create the calculator class in a separate CS file in the web project, and
    then you can access it from either page. If you want the page to hold the
    instance of the class I would create a property in the user control that
    takes a type of Calculator and it has a set that sets a local variable.

    --
    Eric Renken
    Demiurge Software LLC
    http://www.demiurge.us



    "Davids" <> wrote in message
    news:...
    > ok this is basic but it really puzzles me.
    > I have an .aspx page and within it a user control (for example
    > mycontrol.aspx and it's code file mycontrol.aspx.cs). In the code for my
    > base page I declare a public calculator class with some simple functions.
    > Now how can I access and use this class' methods from the user control
    > code, the compiler keeps saying "The type or namespace name 'Calculator'
    > could not be found "
    >
    > PS I'm not using dll files just Src="" attributes in the directives
    >
    Eric Renken, Nov 6, 2004
    #2
    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. Verbal Kint
    Replies:
    6
    Views:
    338
    Verbal Kint
    Dec 21, 2006
  2. Steve Richter
    Replies:
    6
    Views:
    705
    Steve Richter
    May 3, 2007
  3. Replies:
    3
    Views:
    929
    Roedy Green
    Jan 28, 2008
  4. Oltmans
    Replies:
    6
    Views:
    342
    Terry Reedy
    Mar 11, 2009
  5. Kenneth McDonald
    Replies:
    5
    Views:
    314
    Kenneth McDonald
    Sep 26, 2008
Loading...

Share This Page