how can I access methods in another class?

D

Davids

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
 
E

Eric Renken

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top