|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Error Creating Control - No parameterless constructor defined for this objectI have created a custom control for ASP.NET using VB.NET. My control inherits from the System.Web.UI.WebControls.CompositeControl class, and is working fine. However, the Visual Studio .NET designer shows the following error on the control in the designer:
Error Creating Control - No parameterless constructor defined for this object I have defined four New methods. Although none of them are simply Public Sub New(), one of them has just one parameter which is optional. I would think that this would cover the requirement of having a parameterless constructor, since it can be called with no parameters. However, the designer doesn't seem to like it (although my control has run succesfully in all my test runs with no errors). When I try adding a parameterless constructor, I recieve an error in the code editor that mentions the overload that has a single optional parameter, which makes since because if it was called with no parameters there would be an ambiguity between them. What can I do about the error message in the designer? Thanks. Visual Studio does not know that the paramter is optional or what to provide in the paramters.
Explicitly have paramterless constructor. -- Happy Hacking, Gaurav Vaish | www.mastergaurav.com www.edujinionline.com http://eduzine.edujinionline.com ----------------------------------------- "Nathan Sokalski" <njsokal***@hotmail.com> wrote in message news:eWto$pRDHHA.2328@TK2MSFTNGP02.phx.gbl... I have created a custom control for ASP.NET using VB.NET. My control inherits from the System.Web.UI.WebControls.CompositeControl class, and is working fine. However, the Visual Studio .NET designer shows the following error on the control in the designer:Error Creating Control - No parameterless constructor defined for this object I have defined four New methods. Although none of them are simply Public Sub New(), one of them has just one parameter which is optional. I would think that this would cover the requirement of having a parameterless constructor, since it can be called with no parameters. However, the designer doesn't seem to like it (although my control has run succesfully in all my test runs with no errors). When I try adding a parameterless constructor, I recieve an error in the code editor that mentions the overload that has a single optional parameter, which makes since because if it was called with no parameters there would be an ambiguity between them. What can I do about the error message in the designer? Thanks. -- Nathan Sokalski njsokal***@hotmail.com http://www.nathansokalski.com/
Saving the Color value into a string
How do I even start debugging this. User Interface Design - Books? Need for Speed find number in a string Can a Decimal variable be set to "Not a Number" Trouble displaying info from access db 2 dimensional array question programmatically allow tcp/ip to msde Radio buttons - best practice |
|||||||||||||||||||||||