Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   How to put a Custom Control on the toolbox. (http://www.velocityreviews.com/forums/t372726-how-to-put-a-custom-control-on-the-toolbox.html)

craigkenisston@hotmail.com 09-28-2006 04:57 AM

How to put a Custom Control on the toolbox.
 
I created a derived class from "Literal". I put the code in the
App_Code folder and the control is working as expected.

Now, I wan this control to be in the ToolBox, just like the others,
what do I need to do ?
Should it be in a separate library file to be able to get this ?

Thanks in advance,


=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?= 09-28-2006 11:43 AM

RE: How to put a Custom Control on the toolbox.
 
You probably just need to add a "ToolboxData" attribute above the class
definition. I don't have the syntax handy, but you can search it and find
numerous examples.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"craigkenisston@hotmail.com" wrote:

> I created a derived class from "Literal". I put the code in the
> App_Code folder and the control is working as expected.
>
> Now, I wan this control to be in the ToolBox, just like the others,
> what do I need to do ?
> Should it be in a separate library file to be able to get this ?
>
> Thanks in advance,
>
>


craigkenisston@hotmail.com 09-28-2006 04:32 PM

Re: How to put a Custom Control on the toolbox.
 

For what it said in the documentation, I think that attribute is for
when you already have it in the Toolbox:

"Specifies the default tag generated for a custom control when it is
dragged from a toolbox in a tool such as Microsoft Visual Studio. "

I'm talking about putting the custom control in the toolbox.

Regards,






Peter wrote:
> You probably just need to add a "ToolboxData" attribute above the class
> definition. I don't have the syntax handy, but you can search it and find
> numerous examples.
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "craigkenisston@hotmail.com" wrote:
>
> > I created a derived class from "Literal". I put the code in the
> > App_Code folder and the control is working as expected.
> >
> > Now, I wan this control to be in the ToolBox, just like the others,
> > what do I need to do ?
> > Should it be in a separate library file to be able to get this ?
> >
> > Thanks in advance,
> >
> >



=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?= 09-28-2006 05:29 PM

Re: How to put a Custom Control on the toolbox.
 
Correct. If your control is built correctly, all you need to do is
right-click on the Toolbox section where you want your control, choose
"Add/Remove Items", and browse to your built control's assembly. In ASP.NET
2.0, if the control project is in your Web Application, this happens
automatically.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"craigkenisston@hotmail.com" wrote:

>
> For what it said in the documentation, I think that attribute is for
> when you already have it in the Toolbox:
>
> "Specifies the default tag generated for a custom control when it is
> dragged from a toolbox in a tool such as Microsoft Visual Studio. "
>
> I'm talking about putting the custom control in the toolbox.
>
> Regards,
>
>
>
>
>
>
> Peter wrote:
> > You probably just need to add a "ToolboxData" attribute above the class
> > definition. I don't have the syntax handy, but you can search it and find
> > numerous examples.
> > Peter
> >
> > --
> > Co-founder, Eggheadcafe.com developer portal:
> > http://www.eggheadcafe.com
> > UnBlog:
> > http://petesbloggerama.blogspot.com
> >
> >
> >
> >
> > "craigkenisston@hotmail.com" wrote:
> >
> > > I created a derived class from "Literal". I put the code in the
> > > App_Code folder and the control is working as expected.
> > >
> > > Now, I wan this control to be in the ToolBox, just like the others,
> > > what do I need to do ?
> > > Should it be in a separate library file to be able to get this ?
> > >
> > > Thanks in advance,
> > >
> > >

>
>


craigkenisston@hotmail.com 09-30-2006 03:47 AM

Re: How to put a Custom Control on the toolbox.
 

Which control's assembly ?
The code is part of the application. That _is_ my question.
Do I need to have in a separated from the asp.net code, in its own
class library ?
Well, it seems yes.


Regards,




Peter wrote:

> Correct. If your control is built correctly, all you need to do is
> right-click on the Toolbox section where you want your control, choose
> "Add/Remove Items", and browse to your built control's assembly. In ASP.NET
> 2.0, if the control project is in your Web Application, this happens
> automatically.
>
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "craigkenisston@hotmail.com" wrote:
>
> >
> > For what it said in the documentation, I think that attribute is for
> > when you already have it in the Toolbox:
> >
> > "Specifies the default tag generated for a custom control when it is
> > dragged from a toolbox in a tool such as Microsoft Visual Studio. "
> >
> > I'm talking about putting the custom control in the toolbox.
> >
> > Regards,
> >
> >
> >
> >
> >
> >
> > Peter wrote:
> > > You probably just need to add a "ToolboxData" attribute above the class
> > > definition. I don't have the syntax handy, but you can search it and find
> > > numerous examples.
> > > Peter
> > >
> > > --
> > > Co-founder, Eggheadcafe.com developer portal:
> > > http://www.eggheadcafe.com
> > > UnBlog:
> > > http://petesbloggerama.blogspot.com
> > >
> > >
> > >
> > >
> > > "craigkenisston@hotmail.com" wrote:
> > >
> > > > I created a derived class from "Literal". I put the code in the
> > > > App_Code folder and the control is working as expected.
> > > >
> > > > Now, I wan this control to be in the ToolBox, just like the others,
> > > > what do I need to do ?
> > > > Should it be in a separate library file to be able to get this ?
> > > >
> > > > Thanks in advance,
> > > >
> > > >

> >
> >



=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?= 09-30-2006 10:06 PM

Re: How to put a Custom Control on the toolbox.
 
Sure, you would. Isn't that the basic idea of a custom control, that it
should be re-usable across different applications? So you would have it in a
separate project (which could be in the same solution as your current
application).
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"craigkenisston@hotmail.com" wrote:

>
> Which control's assembly ?
> The code is part of the application. That _is_ my question.
> Do I need to have in a separated from the asp.net code, in its own
> class library ?
> Well, it seems yes.
>
>
> Regards,
>
>
>
>
> Peter wrote:
>
> > Correct. If your control is built correctly, all you need to do is
> > right-click on the Toolbox section where you want your control, choose
> > "Add/Remove Items", and browse to your built control's assembly. In ASP.NET
> > 2.0, if the control project is in your Web Application, this happens
> > automatically.
> >
> > Peter
> >
> > --
> > Co-founder, Eggheadcafe.com developer portal:
> > http://www.eggheadcafe.com
> > UnBlog:
> > http://petesbloggerama.blogspot.com
> >
> >
> >
> >
> > "craigkenisston@hotmail.com" wrote:
> >
> > >
> > > For what it said in the documentation, I think that attribute is for
> > > when you already have it in the Toolbox:
> > >
> > > "Specifies the default tag generated for a custom control when it is
> > > dragged from a toolbox in a tool such as Microsoft Visual Studio. "
> > >
> > > I'm talking about putting the custom control in the toolbox.
> > >
> > > Regards,
> > >
> > >
> > >
> > >
> > >
> > >
> > > Peter wrote:
> > > > You probably just need to add a "ToolboxData" attribute above the class
> > > > definition. I don't have the syntax handy, but you can search it and find
> > > > numerous examples.
> > > > Peter
> > > >
> > > > --
> > > > Co-founder, Eggheadcafe.com developer portal:
> > > > http://www.eggheadcafe.com
> > > > UnBlog:
> > > > http://petesbloggerama.blogspot.com
> > > >
> > > >
> > > >
> > > >
> > > > "craigkenisston@hotmail.com" wrote:
> > > >
> > > > > I created a derived class from "Literal". I put the code in the
> > > > > App_Code folder and the control is working as expected.
> > > > >
> > > > > Now, I wan this control to be in the ToolBox, just like the others,
> > > > > what do I need to do ?
> > > > > Should it be in a separate library file to be able to get this ?
> > > > >
> > > > > Thanks in advance,
> > > > >
> > > > >
> > >
> > >

>
>



All times are GMT. The time now is 01:37 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.