D
Dave
In
http://msdn2.microsoft.com/en-us/li...bcontrols.webparts.genericwebpart(VS.80).aspx
it states...
"..If you inherit from the GenericWebPart class, you also need to inherit
from the WebPartManager class and override its CreateWebPart method to enable
it to create your custom control..."
However, I've tried this using two classes
public class CustomGenericWebPart : GenericWebPart
{
public CustomGenericWebPart(Control control) : base(control) {}
}
public class CustomWebPartManager : WebPartManager
{
public CustomWebPartManager()
{
//
// TODO: Add constructor logic here
//
}
override public CustomGenericWebPart CreateWebPart (Control control)
{
CustomGenericWebPart customWebPart; //just to see if I can return
it....
return customWebPart;
}
}
error...
return type must be 'System.Web.UI.WebControls.WebParts.GenericWebPart' to
match overridden member
'System.Web.UI.WebControls.WebParts.WebPartManager.CreateWebPart(System.Web.UI.Control)'
Do I have somehow use the "new" when declaring this? When I tried that it
stated
Type 'CustomWebPartManager' already defines a member called 'CreateWebPart'
with the same parameter types.
I'm having a hard time finding any sample code but apparently you can do
according the MS link.
http://msdn2.microsoft.com/en-us/li...bcontrols.webparts.genericwebpart(VS.80).aspx
it states...
"..If you inherit from the GenericWebPart class, you also need to inherit
from the WebPartManager class and override its CreateWebPart method to enable
it to create your custom control..."
However, I've tried this using two classes
public class CustomGenericWebPart : GenericWebPart
{
public CustomGenericWebPart(Control control) : base(control) {}
}
public class CustomWebPartManager : WebPartManager
{
public CustomWebPartManager()
{
//
// TODO: Add constructor logic here
//
}
override public CustomGenericWebPart CreateWebPart (Control control)
{
CustomGenericWebPart customWebPart; //just to see if I can return
it....
return customWebPart;
}
}
error...
return type must be 'System.Web.UI.WebControls.WebParts.GenericWebPart' to
match overridden member
'System.Web.UI.WebControls.WebParts.WebPartManager.CreateWebPart(System.Web.UI.Control)'
Do I have somehow use the "new" when declaring this? When I tried that it
stated
Type 'CustomWebPartManager' already defines a member called 'CreateWebPart'
with the same parameter types.
I'm having a hard time finding any sample code but apparently you can do
according the MS link.