A
Allan Ebdrup
We're pretty new to ASP.Net 2.0 and we're having a discussion about best
practice when developing custom server web controls.
I can see that in for example the Wizard control the table contained within
is a control and all the children are controls.
That seems to be a good practice to me, use controls when possible.
On the other hand one of the developers here wants to override the Render
methods and create child tables with strings and a HtmlTextWriter.
In my view that introduces a lot of problems since you can easily make a
mistake in the Html you output, and you don't get any programatical access
to all the children that you have if you use controls.
On the other hand the developer here thinks that all those controls make a
mess, he just want the children of the control to be the stuff that actually
matters, not stuff like tables that are just there for layout purposes.
What's your take on this? What's a good practice? Use controls whenever
possible and only override the Render methods when you absolutely have to?
Or override the render methods every time you can?
Kind Regards,
Allan Ebdrup
practice when developing custom server web controls.
I can see that in for example the Wizard control the table contained within
is a control and all the children are controls.
That seems to be a good practice to me, use controls when possible.
On the other hand one of the developers here wants to override the Render
methods and create child tables with strings and a HtmlTextWriter.
In my view that introduces a lot of problems since you can easily make a
mistake in the Html you output, and you don't get any programatical access
to all the children that you have if you use controls.
On the other hand the developer here thinks that all those controls make a
mess, he just want the children of the control to be the stuff that actually
matters, not stuff like tables that are just there for layout purposes.
What's your take on this? What's a good practice? Use controls whenever
possible and only override the Render methods when you absolutely have to?
Or override the render methods every time you can?
Kind Regards,
Allan Ebdrup