Custom Control Referencing Global.asax --- Possible?

R

Ron

I need to write a custom textbox control that references an object located
in the Global.asax class, but I can't compile the control into a DLL without
including the reference to the project DLL that includes the Global.asax
assembly.

I've tried reflection, but I can't seem to make it work correctly.

Does anyone have any ideas how I can make this happen?

Thanks,

Ron

--


--------------------------------------------------------------
Ron Rodenberg
Lead Software Engineer
Razorvision Technology
8080 N. Central Expressway
Suite 400
Dallas, TX 75206
 
J

Juan Wajnerman

To avoid circular references in your project, you can expose a
property in the custom control to be set at runtime with the reference
to the global object.
 
R

Ron

Yea thats what I am trying to do, unfortunately the DLL will not compile
without having the "/reference: AppName.dll" reference (the assembly is
needed so that the compiler will know that the Global class exists.
Unfortunately, I can't add the resulting assembly into my project because of
the dual reference.

I need to reference an object in a different assembly without explicitly
referencing the assembly at compile time.

Any ideas?



--


--------------------------------------------------------------
Ron Rodenberg
Lead Software Engineer
Razorvision Technology
8080 N. Central Expressway
Suite 400
Dallas, TX 75206
 
J

John Saunders

Ron said:
Yea thats what I am trying to do, unfortunately the DLL will not compile
without having the "/reference: AppName.dll" reference (the assembly is
needed so that the compiler will know that the Global class exists.
Unfortunately, I can't add the resulting assembly into my project because of
the dual reference.

I need to reference an object in a different assembly without explicitly
referencing the assembly at compile time.

No. You need to reference a type in a different assembly without explicitly
referencing the assembly at compile time.

Which is impossible, since the assembly is where it's going to get the type
from!

Since this type needs to be referenced by at least two assemblies, you
should assume that it will eventually need to be referenced by more than
two. Put it in a library. Create a separate class library project and define
the type there. Reference the new project both from your global.asax and
from your control.
 

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

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top