Could I add component to toolbox in VS2005 WebSite Project?

A

alberthung01

Hi all,
I wrote a component with ComponentDesigner
to let users drag and drop it to WebPage from toolbox directly.
Just like the behavior of dataAdapter.
But it works fine on ASP.NET 1.1 but not on ASP.NET 2.0.
Sometimes I add it to toolbox in VS2005 WebSite Project but it will
not appear.
And always it can't be drag and drop to WebPage any more.
Nothing will be added to page after that.

Here is my code structure
---------------------------------------
//Class
[ToolboxItemFilter("System.Web.UI",ToolboxItemFilterType.Require),
Designer(typeof(Ares.Workflow.WebControls.AFWebUIControlDesigner))
]
public class AFWebUIControl : System.ComponentModel.Component
{
public AFWebUIControl()
{
}
}

//Designer
public class AFWebUIControlDesigner : ComponentDesigner
{
public override void Initialize(IComponent component)
{
base.Initialize(component);
}
}
 
S

S. Justin Gengo

Albert,

This one got me for a little while too. Microsoft changed some Visual Studio
functionality when they went to Visual Studio 2005.

In the previous version you could drag a component control onto a page (in
design view) and the Component Designer window would appear at the bottom of
the page.

In Visual Studio 2005 the component designer has been separated from the
display page. Component Designer objects won't even appear in the toolbox
unless the new component designer window has been displayed first. To do so:
Go to the design view of one of your pages and then in the menu go to
View - Component Designer. Like magic your toolbox should now contain your
component and let you drag it to the designer.

Regards,

--
S. Justin Gengo, MCP
justin@aboutfortunate[-NoSpam-].com

Free code library at:
www.aboutfortunate.com
 
A

alberthung01

Albert,

This one got me for a little while too. Microsoft changed some Visual Studio
functionality when they went to Visual Studio 2005.

In the previous version you could drag a component control onto a page (in
design view) and the Component Designer window would appear at the bottom of
the page.

In Visual Studio 2005 the component designer has been separated from the
display page. Component Designer objects won't even appear in the toolbox
unless the new component designer window has been displayed first. To do so:
Go to the design view of one of your pages and then in the menu go to
View - Component Designer. Like magic your toolbox should now contain your
component and let you drag it to the designer.

Regards,

--
S. Justin Gengo, MCP
justin@aboutfortunate[-NoSpam-].com

Free code library at:www.aboutfortunate.com




Hi all,
I wrote a component with ComponentDesigner
to let users drag and drop it to WebPage from toolbox directly.
Just like the behavior of dataAdapter.
But it works fine on ASP.NET 1.1 but not on ASP.NET 2.0.
Sometimes I add it to toolbox in VS2005 WebSite Project but it will
not appear.
And always it can't be drag and drop to WebPage any more.
Nothing will be added to page after that.
Here is my code structure
---------------------------------------
//Class
[ToolboxItemFilter("System.Web.UI",ToolboxItemFilterType.Require),
Designer(typeof(Ares.Workflow.WebControls.AFWebUIControlDesigner))
]
public class AFWebUIControl : System.ComponentModel.Component
{
public AFWebUIControl()
{
}
}
//Designer
public class AFWebUIControlDesigner : ComponentDesigner
{
public override void Initialize(IComponent component)
{
base.Initialize(component);
}
}
---------------------------------------
Any help will be appreciated.
Albert- -

- -

Hi Justin,
Thanks for your help!
It works now after I remove the ToolboxItemFilter and display the
Component Designer.
Really magic!

Best Regards,
Albert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top