StrataFrame Forum

Business Objects in Toolbox

http://forum.strataframe.net/Topic4019.aspx

By Vikram Saxena - 10/31/2006

Hello,

For some reason i am not getting the BusinessComponents in the VS2005 Toolbox though it should be there. Please see the attached snapshot to elaborate my issue.

Vikram

By Trent L. Taylor - 10/31/2006

It looks as though you are trying to select a business object DLL and have the BOs within that DLL show up in your toolbox...correct?  If this is the case, try un-checking the items then re-checking them to see if they appear.  Also, make sure that they are not showing up in some other tab in the toolbox (this has happened to me before) Smile.
By Vikram Saxena - 11/6/2006

I have tried checking/unchecking and also confirmed that the component does not appear in any other tab. for your reference i have attached my web & BOL project along with the snapshot. would really appreciate any help.
By Trent L. Taylor - 11/6/2006

Oh...I see the problem you are having....you have a web project. Smile  Sorry I did not catch this earlier.  Business Objects are WinForms components and do no get directly dropped onto a page in a WebForms application.  This is what the ApplicationBasePage is for.  You define all of your BOs in the ApplicationBasepage and they will be automatically managed by the framework.

Open up the ApplicationBasePage and add your business object definitions here:

#Region " Business Object Declarations "

 '-- Business Objects defined within this class will be available to
 '   inherited pages as binding sources to bindable controls.  These
 '   business objects will also be persisted within session variables
 '   and retrieved each time the page loads.  If the business object
 '   is declared WithEvents, events can be handled without the need
    '   for AddHandler calls.
    Public WithEvents MyBusinessObject As YourBusinessObjectType
       
#End Region

Notice that you do not call the New statement as these BOs will be dynamically created and stored in the session.  You can see more about this in the help documentation under: Application -> WebForms -> ApplicationBasePage Classes -> Overview