Re: using user control in form & using design time question

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: TS (manofsteele_at_nospam.nospam)
Date: 02/10/05


Date: Thu, 10 Feb 2005 15:50:50 -0600

if i have the user control as a dll and add it to the toolbox, when i update
the dll, i delete it from the toolbox, then add it back, but it is still the
old version. What do i have to do to get the new version as the one that is
dragged from the toolbox

""Jeffrey Tan[MSFT]"" <v-jetan@online.microsoft.com> wrote in message
news:5TY0esxDFHA.952@TK2MSFTNGXA01.phx.gbl...
> Hi TS,
>
> Thanks for your posting!!
>
> For your original issue, I think you must change your usercontrol's server
> side code in the .aspx file, not the code behind file, yes? Actually, in
> webform, the .aspx file will be complied at run-time, and when compiling
> the webform project, the compiler will not verify the C# code in .aspx
> file, so when VS.net compiles the webform project, compiler will not know
> if the used properties/methods in the .aspx exists in UserControl class.
> However, when the web application is going to run, the Asp.net runtime
will
> dynamically parse .aspx page, generate a temp assembly for the entire
> webform project, at this time, the asp.net runtime will COMPILE the .aspx
> page and verify the C# code, and now the .aspx will associate with the
> usercontrol code.
>
> For winform application, the entire project will compile at once, without
2
> times. But I am not sure what your meaning of "access its
> properties/methods at design time", do you mean the intellisense support
in
> VS.net IDE for the usercontrol new added members? Actually, I think if we
> have a usercontrol for a form, then we added a new "Test" public field to
> the usercontrol, then explicitly use this field in the Form class without
> compile the project, then we explicitly pressed ctrl+F5, the VS.net will
> first re-compile the entire project, and the code can be used without any
> problem. But there is no intellisense for "Test" property in the Form
> class, because the Winform application is not compiled, and not metadata
is
> emitted into the assembly, so there is not metadata information for VS.net
> to know this change and display the "Test" property in the intellisense
> dropdownlist.
>
> For the later issue, I agree with you that whether to place several
> usercontrols in single project or separate project is determined by
several
> assemblies or a single assembly. Also, there is an extra little
difference,
> that is the "internal" key word in C#, please refer this extra information
> in MSDN.
>
> Hope this helps
> ======================================================
> Thank you for your patience and cooperation. If you have any questions or
> concerns, please feel free to post it in the group. I am standing by to be
> of assistance.
>
> Best regards,
> Jeffrey Tan
> Microsoft Online Partner Support
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
>



Relevant Pages

  • Re: using user control in form & using design time question
    ... webform, the .aspx file will be complied at run-time, and when compiling ... if the used properties/methods in the .aspx exists in UserControl class. ... For winform application, the entire project will compile at once, without 2 ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Declare UserControl in a class
    ... I have a UserControl with the name Toolbox, ... I want to pass this UserControl to a function in another class, ... In an aspx page this is not a problem, because in an aspx page I can ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Global subroutines
    ... >> surround the code with the script tags. ... > HTML code for Global.asax (usually, an aspx combo has three different ... and the code-behind file which sits in another window. ... > You definitely need to compile the file in any case. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Confused Using VB in VS2003
    ... your .aspx page and your code-behind file ... code-behind file, into .dll files. ... Now, when a client requests your .aspx page, ASP.NET will compile only ...
    (microsoft.public.dotnet.languages.vb)
  • Re: <%@ Page Language... question
    ... If you put your code in the code-behind file, then the site must be compiled ... ASPX page inherits from that. ... (Parser error I believe) ... If you don't compile your code, ...
    (microsoft.public.dotnet.framework.aspnet.webservices)