BusinessObject1 myBO = new BusinessObject1();
Whenever I go to a page in my app that inherits from ApplicationBasePage I cannot see the object I created above. Do I have a scoping issue or something?
Something else that is very frustrating is whenever I compile my business object it does not show up in my toolbox to allow me to drop it on a web form. Are we suppose to drop the business objects on Web Forms or do we reference it some other way?
A C# ASP.NET demo would certainly be helpful.
Any help is greatly appreciated.
Thanks,Scott
Thanks for the response. Do you have a code snipet in C#. I've tried declaring the object as you suggested (in C#) and it still doesn't seem to work. Just want to be sure I understand.
Thanks,
Scott
Are you defining your business objects in the same project as your web project? If so, this could be a problem. ASP.NET does not like to "play nice" with component classes defined within an ASP.NET project. The best thing to do is create a Business Object Library and then place all of your business objects within that library. Your ASP.NET app will then just reference the library and it will make things go much more smoothly. If this doesn't work, I will be more than happy to get you a C# snippet.
I got it figured out. To answer your question, my Business Object library is a separate project from my application. I've got it referenced in my solution. In order to define my BO in the ApplicationBasePage I declare the following:
private BusinessObject1 _MyBO;
public BusinessObject1 MyBO
{
get
}
This works well.
Thanks for your input.
So, always define your business objects as properties within the ApplicaitonBasePage and you'll be good to go.