By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,302 Members | 1,788 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,302 IT Pros & Developers. It's quick & easy.

codebehind and custom objects

P: n/a

Say I have a code behind class, and in that I want to instantiate and call
methods on some objects Ive written in other cs files, what do I need to do
to make those objects available within the codebehind?

thanks in advance
Nov 18 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Karl,

Add an assembly reference (if they're not in the current assembly) and add
the namespace with a using command.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
"Karl Hungus" <nn*********@hotmail.com> wrote in message
news:OH****************@twister.nyc.rr.com...

Say I have a code behind class, and in that I want to instantiate and call
methods on some objects Ive written in other cs files, what do I need to do to make those objects available within the codebehind?

thanks in advance

Nov 18 '05 #2

P: n/a
IF it is in the same assembly you can just Instantiate the class and call
its methods. If not you must a reference to the assembly and add an imports
or includes statement in the codebehind class

"Karl Hungus" <nn*********@hotmail.com> wrote in message
news:OH****************@twister.nyc.rr.com...

Say I have a code behind class, and in that I want to instantiate and call
methods on some objects Ive written in other cs files, what do I need to do to make those objects available within the codebehind?

thanks in advance

Nov 18 '05 #3

P: n/a

Forgive me, Im new to asp.net - Does this mean I need to compile my custom
classes into dlls?

where do I add an assembly reference?

thanks in advance,
Karl

"Rick Strahl [MVP]" <ri********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Karl,

Add an assembly reference (if they're not in the current assembly) and add
the namespace with a using command.

+++ Rick ---

Nov 18 '05 #4

P: n/a

If they are in the same project/binary file you can just instantiate them.
If they are not then you need to reference the assembly (DLL).

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
"Karl Hungus" <nn*********@hotmail.com> wrote in message
news:vY****************@twister.nyc.rr.com...

Forgive me, Im new to asp.net - Does this mean I need to compile my custom
classes into dlls?

where do I add an assembly reference?

thanks in advance,
Karl

"Rick Strahl [MVP]" <ri********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Karl,

Add an assembly reference (if they're not in the current assembly) and add the namespace with a using command.

+++ Rick ---


Nov 18 '05 #5

P: n/a

Is this something that is possible to do if you
A. dont use visual studio
and
B. have a shared hosting account?

"Rick Strahl [MVP]" <ri********@hotmail.com> wrote in message
news:eP**************@TK2MSFTNGP10.phx.gbl...

If they are in the same project/binary file you can just instantiate them.
If they are not then you need to reference the assembly (DLL).

Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.