Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Nathan Sokalski #1
Error Creating Control - No parameterless constructor defined for this object
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
[email]njsokalski@hotmail.com[/email]
[url]http://www.nathansokalski.com/[/url]
Nathan Sokalski Guest
-
constructor in dynamicly loaded library containing user defined functions not run when loading from mysql?
Hi, I've been writing a user defined function with a very expensive initialisation which only needs to run once. I thought it might be possible... -
#26121 [Opn->WFx]: Object defined before object - error
ID: 26121 Updated by: sniper@php.net Reported By: closer at netnitco dot net -Status: Open +Status: ... -
#26121 [NEW]: Object defined before object - error
From: closer at netnitco dot net Operating system: Redhat Linux 9.0 / Apache 2.0.46 PHP version: 5.0.0b2 (beta2) PHP Bug Type: ... -
Fatal error: Call to a member function on a non-object in constructor?
Hi, I'm having a problem that I have a hard time understanding. I am getting a "Fatal error: Call to a member function on a non-object" on a... -
Error in CreatObject(""): 32797: Application-defined or object-define error
Hi, I am getting "Application-defined or object-define error" when trying to instantiate an MTS component. However, when I run the VB source-code... -
Gaurav Vaish \(www.EdujiniOnline.com\) #2
Re: Error Creating Control - No parameterless constructor defined for this object
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 | [url]www.mastergaurav.com[/url]
[url]www.edujinionline.com[/url]
[url]http://eduzine.edujinionline.com[/url]
-----------------------------------------
"Nathan Sokalski" <njsokalski@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
[email]njsokalski@hotmail.com[/email]
[url]http://www.nathansokalski.com/[/url]
Gaurav Vaish \(www.EdujiniOnline.com\) Guest



Reply With Quote

