L
Laurent Bugnion
Hi,
I like to develop custom controls for a number of webpages. These
controls are often customizable, so that they can be reused in a number
of situations.
My question is: What is the best practice for configuring a custom
control. As far as I can say, I have the following alternatives:
- Defining properties for the control, and setting these in the ASPX
page where the control is included (this is what I do now). This has the
advantage that the settings are defined in the same file as the control
itelf, only one file to manage. However, when there are many settings,
one might lose the overview. Also, these properties are parsed on every
roundtrip, so it's not really efficient.
- Using a settings section in web.config. This has the advantage that
settings are not parsed on every roundtrip.
- A mix of these two solutions.
What are your thoughts?
Greetings,
Laurent
I like to develop custom controls for a number of webpages. These
controls are often customizable, so that they can be reused in a number
of situations.
My question is: What is the best practice for configuring a custom
control. As far as I can say, I have the following alternatives:
- Defining properties for the control, and setting these in the ASPX
page where the control is included (this is what I do now). This has the
advantage that the settings are defined in the same file as the control
itelf, only one file to manage. However, when there are many settings,
one might lose the overview. Also, these properties are parsed on every
roundtrip, so it's not really efficient.
- Using a settings section in web.config. This has the advantage that
settings are not parsed on every roundtrip.
- A mix of these two solutions.
What are your thoughts?
Greetings,
Laurent