Include code in other Cs files 
Author Message
 Include code in other Cs files

Hi,

Is there a way to let "a.ascx.cs" know of a class declared in "b.ascx.cs".

namespace Namespace
{
    public class A: System.Web.UI.UserControl
    {
        // This is the problem!
        // Namespace.B is delcared in "b.ascx.cs" but "a.ascx.cs" doesn't
know of it's existence
        protected Namespace.B controlB;
    }

Quote:
}

We DO want to use CodeBehind but DO NOT want to "pre-compile" all our code,
we added Src=".." to all of our .ascx files.

Erik Tamminga
MCSD



Mon, 28 Jun 2004 21:07:51 GMT  
 Include code in other Cs files
You have no other choice then but to use Reflection.


Quote:
> Hi,

> Is there a way to let "a.ascx.cs" know of a class declared in "b.ascx.cs".

> namespace Namespace
> {
>     public class A: System.Web.UI.UserControl
>     {
>         // This is the problem!
>         // Namespace.B is delcared in "b.ascx.cs" but "a.ascx.cs" doesn't
> know of it's existence
>         protected Namespace.B controlB;
>     }
> }

> We DO want to use CodeBehind but DO NOT want to "pre-compile" all our
code,
> we added Src=".." to all of our .ascx files.

> Erik Tamminga
> MCSD



Mon, 28 Jun 2004 21:26:11 GMT  
 Include code in other Cs files
Can anyone pint me to some good sample code for Reflection.  I am trying to
instantiate a user control contained in an assembly at runtime.  I am using
Assembly.LoadFrom but have no idea how to create an instance of the control,
and cannot find any documentation.
Thanks,
grimley.



Quote:
> You have no other choice then but to use Reflection.



> > Hi,

> > Is there a way to let "a.ascx.cs" know of a class declared in
"b.ascx.cs".

> > namespace Namespace
> > {
> >     public class A: System.Web.UI.UserControl
> >     {
> >         // This is the problem!
> >         // Namespace.B is delcared in "b.ascx.cs" but "a.ascx.cs"
doesn't
> > know of it's existence
> >         protected Namespace.B controlB;
> >     }
> > }

> > We DO want to use CodeBehind but DO NOT want to "pre-compile" all our
> code,
> > we added Src=".." to all of our .ascx files.

> > Erik Tamminga
> > MCSD



Tue, 29 Jun 2004 05:51:46 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Newbie: separate big .cs file into small .cs files

2. standard headers including others

3. include another form(cs) in C#?

4. resx files needed for cs - files ??

5. CS files display in VS6 like CPP files ?

6. Trouble Appending Files, code included can anyone help?

7. coding an algorithm for flexible use: include files

8. HELP: jpeg from file works great but memory leak - code included

9. jepg from file causing memory leak, code included

10. newbe/cs student, need help w/ code

11. Compile CS source code using ICodeCompiler

12. cs source code

 

 
Powered by phpBB® Forum Software