Hi,
I'm looking for samples of ASP.NET projects where the programming has been
done almost entirely using codebehind and classes with very little code in
the aspx files themselves.
I would like to be able to write ASP.NET pages where I represented the
elements on the page entirely with classes in codebehind (let's call them
RenderClasses). The idea would be that each of these classes would have a
Render method which would cause the appropriate html to be generated on
screen when it was called so that the visual element that the class instance
represented would be displayed in the browser.
So when the page loaded (in Page_Load), I would instantiate different types
of these RenderClasses, set their various properties and then I would call
their Render methods. Also, if I needed to change the appearance of the page
after user interaction, I would simply change the properties of these
instances in codebehind and then call the Render method. (Something like the
model-view-controller architecture.)
I know that the ASP.NET model has classes that derive from
System.Web.UI.Control that represent many of the common elements we have in
forms. Would these classes do exactly what I want? Would it be possible for
me to have an aspx page which had no html at all, with the html being
generated by the Render methods? And very importantly, does anyone know of
any sample project that has been written using this technique? Are there any
potential pitfalls in terms of server processing?
Thanks in advance,
--
Akin
aknak at aksoto dot idps dot co dot uk
of these classes that would cause appropriate content to be displayed on
the browser. Also, if I needed to change the appearance of the page through
user interaction, I would change the properties of the class instances then
call the Render method