Re: User Control and Textbox Inheritance

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




houghtelling@xxxxxxxxx wrote:
Is it posible to inherit from a textbox and then place that inherited
textbox onto a user control in that same project?

Yes, but between the time that you create the inherited text box class
and the time that you try to place it on the user control you have to
have done a successful build of the project. As well, if you ever have
the Designer open on the user control when the project fails to
compile, the Designer may decide to remove the inherited text box from
the user control, because there will be no compiled assembly for it.

When I try to do this I get the error: "Could not find type
'MyTextBox'. Please make sure that the assembly that contains this type
is referenced. If this type is a part of your development project, make
sure that the project has been successfully built."

Probably because your project has failed to compile, so the compiled
assembly is gone, and so the Designer no longer knows what MyTextBox is.

.



Relevant Pages

  • Re: Compile ASP.Net 2.0
    ... That's why there was a ClientID property in v1.x. ... Anyone would certainly need to do thorough testing before moving their app live under v2.0. ... There is no longer an underscore starting the prefix of a control in a user control. ... If your ASP.NET 1.x app didn't use VS.NET to compile, then you can just deploy it as-is and let the demand compile take care of ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Compiling directories in web project...
    ... I am not sure what you mean by the modular user control that dotnetnuke uses. ... What is need is an option to just compile one directory (to minimize the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: This should be really simple but I just cant do it...
    ... Choose "User Control" ... Compile your project. ... Now your control shows up on the toolbox under a tab named after ... Expand the "Windows Forms Designer" (last root element on the tree ...
    (microsoft.public.vstudio.general)
  • compilation and/or getting to the "ASP" assembly
    ... It occurs to me that maybe LoadControl is recompiling the ascx page every ... when ASP.NET needs to load this user control it compiles ... presumably this goes into some dynamically created "ASP" assembly somewhere. ... Alternatively is there a way to compile my own ascx file into a type that I ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)
  • Re: This should be really simple but I just cant do it...
    ... Choose "User Control" ... Compile your project. ... Now your control shows up on the toolbox under a tab named after ... Expand the "Windows Forms Designer" (last root element on the tree ...
    (microsoft.public.vstudio.general)