Ponder points. "code behind" framework

  • Thread starter Thread starter Girish
  • Start date Start date
G

Girish

I understand that the code behind concept is a framework that separates code
logic from visulization code.

I belive this is true for pages that are mostly static. Ie. Forms elements
on a page that are fixed in number.

What if i had a requirement that involves a highly dynamic page, with a
dynamic number of form elements based on various user selections. I cant
see how I cant separate code that splits the "form generation logic" as a
code behind and have another file that would just hold "visulisation code".

Any thoughts on this?

Thanks,
Girish
 
If your page is completely unpredictable, then the .aspx page would be
pretty much empty, and the code behind would truly generate all the content.
It can do this by dynamically creating elements (textboxes, labels, grids,
etc) and adding them to the page at run time.

Otherwise, your page might have placeholders for certain pieces, and your
codebehind would filll in the blanks at run time depending on what it needed
to do.

So this model allows for any level of extensibility. The page can be
completely static, or completely dynamic, and this model supports both.
 
Back
Top