Click here to Skip to main content
15,887,376 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: When and where does a UserControl compile? Pin
Dev S6-Apr-09 3:52
Dev S6-Apr-09 3:52 
GeneralRe: When and where does a UserControl compile? Pin
Brady Kelly6-Apr-09 3:56
Brady Kelly6-Apr-09 3:56 
GeneralRe: When and where does a UserControl compile? Pin
Yusuf6-Apr-09 4:14
Yusuf6-Apr-09 4:14 
AnswerRe: When and where does a UserControl compile? Pin
Yusuf6-Apr-09 4:29
Yusuf6-Apr-09 4:29 
GeneralRe: When and where does a UserControl compile? Pin
Brady Kelly6-Apr-09 4:37
Brady Kelly6-Apr-09 4:37 
GeneralRe: When and where does a UserControl compile? Pin
Yusuf6-Apr-09 4:48
Yusuf6-Apr-09 4:48 
GeneralRe: When and where does a UserControl compile? Pin
Brady Kelly6-Apr-09 5:04
Brady Kelly6-Apr-09 5:04 
AnswerRe: When and where does a UserControl compile? Pin
Rama Krishna Vavilala6-Apr-09 5:12
Rama Krishna Vavilala6-Apr-09 5:12 
The way the ASP.NET compilation works is pretty complex. In general it is not possible to use control/page references across web pages unless you are using @Reference[^].

The reason why referencing UserControl works sometimes and not some other times is because it is up to the discretion of ASP.NET build provider to build the control and page in the same assembly or in different assemblies. When they are in the same assembly things will work and when they are in different assemblies things will not. For pages the assembly names are generally of the form App_Web.If the compilation is in one go everything will be in the same assembly but on the client site probably the web site was already compiled and you added the user control later on. In any case it is better not to expect that user controls and assemblies will be in the same assembly.

There are 2 ways to solve this issue:

1. Declare an interface and put that interface in App_Code directory. The App_Code directory is referenced by all pages/controls automatically. Make the user control implement this interface. In the page access this interface.

2. Move to Web Application projects. The web application project compiles the cs code into a single assembly and you can reference controls from the pages and so on.
GeneralRe: When and where does a UserControl compile? Pin
Brady Kelly6-Apr-09 5:22
Brady Kelly6-Apr-09 5:22 
GeneralRe: When and where does a UserControl compile? Pin
Rama Krishna Vavilala6-Apr-09 5:27
Rama Krishna Vavilala6-Apr-09 5:27 
AnswerRe: When and where does a UserControl compile? Pin
Paddy Boyd6-Apr-09 5:24
Paddy Boyd6-Apr-09 5:24 
GeneralRe: When and where does a UserControl compile? Pin
Brady Kelly6-Apr-09 5:25
Brady Kelly6-Apr-09 5:25 
GeneralRe: When and where does a UserControl compile? Pin
Paddy Boyd6-Apr-09 5:29
Paddy Boyd6-Apr-09 5:29 
GeneralHide/Show Div when selecting radio button Pin
M. K. BASHER6-Apr-09 2:15
M. K. BASHER6-Apr-09 2:15 
GeneralRe: Hide/Show Div when selecting radio button Pin
Dev S6-Apr-09 2:23
Dev S6-Apr-09 2:23 
GeneralRe: Hide/Show Div when selecting radio button Pin
M. K. BASHER6-Apr-09 2:28
M. K. BASHER6-Apr-09 2:28 
GeneralRe: Hide/Show Div when selecting radio button Pin
Alok Sharma ji6-Apr-09 2:31
Alok Sharma ji6-Apr-09 2:31 
GeneralRe: Hide/Show Div when selecting radio button Pin
Dev S6-Apr-09 2:38
Dev S6-Apr-09 2:38 
AnswerRe: Hide/Show Div when selecting radio button [modified] Pin
PauloCastilho6-Apr-09 6:36
PauloCastilho6-Apr-09 6:36 
GeneralRe: Hide/Show Div when selecting radio button Pin
Hajab6-Apr-09 19:58
Hajab6-Apr-09 19:58 
AnswerRe: Hide/Show Div when selecting radio button Pin
vivek_r7-Apr-09 0:12
vivek_r7-Apr-09 0:12 
QuestionAsp.net support Webdav Protocol? Pin
balu123456-Apr-09 2:11
balu123456-Apr-09 2:11 
AnswerRe: Asp.net support Webdav Protocol? Pin
SeMartens6-Apr-09 2:30
SeMartens6-Apr-09 2:30 
QuestionDate Conversion Problem Pin
specialdreamsin6-Apr-09 1:34
specialdreamsin6-Apr-09 1:34 
AnswerRe: Date Conversion Problem Pin
Dev S6-Apr-09 1:49
Dev S6-Apr-09 1:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.