J
Josh Harris
Here is my question:
It is common to have many pieces of business logic encapsulated within
asp.net user controls. This can be found in high visibility projects
such as the iBuySpy portal from MS. Virtually every bit of the site
is encapsulated within user controls. The problem begins when you try
to have user controls pass information to one another as well as to
their parent form. This can be accomplished by creating public
properties of the user controls, and then referencing those properties
to get around the issue of the parents page load event occuring before
the event handler in the user control (assuming that you have an event
that needs to send information to the parent page). This is great as
long as you can easily create a public property that can return what
you need from the user control before its event handler fires (such as
grabbing text from a user input text box) But what about more complex
needs, such as a user control that contains a datagrid that a user can
select a record which then needs to pass information from that record
to a different user control on the same page? This can be very
convoluted -although it is possibly to get around most of these
issues, I'm just wondering if there are better ways to handle this
kind of interoperability or if we are stuck with public properties for
most applications...
It is common to have many pieces of business logic encapsulated within
asp.net user controls. This can be found in high visibility projects
such as the iBuySpy portal from MS. Virtually every bit of the site
is encapsulated within user controls. The problem begins when you try
to have user controls pass information to one another as well as to
their parent form. This can be accomplished by creating public
properties of the user controls, and then referencing those properties
to get around the issue of the parents page load event occuring before
the event handler in the user control (assuming that you have an event
that needs to send information to the parent page). This is great as
long as you can easily create a public property that can return what
you need from the user control before its event handler fires (such as
grabbing text from a user input text box) But what about more complex
needs, such as a user control that contains a datagrid that a user can
select a record which then needs to pass information from that record
to a different user control on the same page? This can be very
convoluted -although it is possibly to get around most of these
issues, I'm just wondering if there are better ways to handle this
kind of interoperability or if we are stuck with public properties for
most applications...