Dynamic Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a web form that has most of the UI designed. On this form, some of the
labels, textboxes, dropdowns, etc. will be added dynamically, depending on
what extra bits of data the user decides they want to see. The question I
have is when retrieving the dynamic fields for my form, should I get
everything in one grab (dynamic fields and data) or keep the form dataset
separate from the actual data dataset? Also, please excuse my ignorance, but
if I get this information in one trip to the server, is this a mix up of
presentation and data layers, or am I totally off base on what those terms
mean? Thanks in advance for any replies.
 
Mike,
There is no point in creating and adding controls programmatically until you
have gotten back the data that your business logic rules dictate what they
should be.

In other words, get the data that results from the user's choices first,
then build and populate the controls needed for it. And don't forget,
dynamically added controls must be re-created on each postback.

A word of caution: If you are at the point in the learning curve where you
need to ask this question (remembering of course that we all start out "in
diapers") then the business of all this dynamic labels, textboxes, dropdowns,
etc. may prove somewhat daunting.

If you can, it may be better to design a page with all of the controls that
may be needed and simply turn on or off their visibilty according to the
logic requirements.

--Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top