Business Object in User Control


Author
Message
Vikram Saxena
Vikram Saxena
StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)StrataFrame Novice (69 reputation)
Group: Forum Members
Posts: 41, Visits: 99
For making any Business Object accessible in any webpage, i inherit the webpage from ApplicationBasePage but i cant do the same with a User Control, so how can i make any business object available to my User Controls ?
Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
What we always do is create a property and then set that property in the Load or the property sheet (depending on how you design it) of the page that uses the control.  This way the control is encapsulated, as it should be.

For example:

Public Property MyCustomers As CustomersBO
...
End Property

This way your control can use the BO that comes from the ApplicationBasePage by simply setting the property when the page is loaded.  Then your control will reference the property instead whenever it needs to access the BO inside of the control.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search