Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   how can I access methods in another class? (http://www.velocityreviews.com/forums/t90250-how-can-i-access-methods-in-another-class.html)

Davids 11-06-2004 12:27 AM

how can I access methods in another class?
 
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 11-06-2004 01:17 AM

Re: how can I access methods in another class?
 
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" <dbspam@simnet.is> wrote in message
news:uypO2d5wEHA.1192@tk2msftngp13.phx.gbl...
> 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
>





All times are GMT. The time now is 05:09 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.