0

Our team is building a new web site with ASP.NET. We plan to use a 3-tier architecture. The problem is that the controls shown on the web page need to be changed all the time according to the customer's requirements, which means adding a pair of label/textbox, or removing a pair of label/dropdownlist when the customer needs it. So the layout needs to be flexible and allow to easily add or remove controls, although it just shows some simple product messages like price, discount, tax, etc.

The previous version of the web site saved all the control information in a database, like control name, control type (textbox, label, dropdownlist), which page and panel it belongs to, etc. You can see there is a big performance hit because every time there is a request to this page, it needs to get all the required controls from the database and add them to the page manually, no matter whether the request is a postback or not.

We thought about adding the controls directly to the .aspx page, but in this case it will be difficult to change them later. We also considered holding all the controls' information in XML files, which may give a little performance advantage, but it still needs to render the controls all the time.

So this is the problem we have, to improve the app's performance and also meet the users' needs at the same time. Could anyone help me with any solutions or ideas?

PS: you can also ask questions if I didn't make it clear enough. Best regards.

dda
  • 6,030
  • 2
  • 25
  • 34
ugoa
  • 117
  • 9
  • If you need this level of flexibility you should consider LightSwitch. Are you trying to build a configurable platform? or do you not want to do requirements gathering up front? – Glenn Ferrie Jul 09 '12 at 03:38
  • @GlennFerrieLive, we are not familiar with LightSwtich and the time is limited. It's not a configurable platform, we just want to isolate the controls adding and removing process and make it less pain. – ugoa Jul 09 '12 at 05:05

2 Answers2

0

This sounds like a good situation for User Controls. If all you're doing is toggling child-control visibility, then creating a user control with toggleable visibility properties should meet your needs. You can still use your backend to toggle visibility, but you'll only need to pull yes/no flags from the db instead of entire page schemas.

From an architectural standpoint, User Controls are great because they encourage modularity, code reuse, and lend themselves well to version control (UsercontrolV1.cs, UserControlsV2.cs, etc). The point on version control is especially great in cases where change requests require logic updates, or simply need to revert to a build that existed x iterations ago.

Daniel Szabo
  • 7,181
  • 6
  • 48
  • 65
  • You mean for each single product message(price, tax, discount, etc) we should wrap it into a user control? In that case, there will be hundreds of little user controls and most of them are similar to each other, it seems a lot of repeat work. Do I misunderstand your point? – ugoa Jul 09 '12 at 05:28
0

Now that is what i call a Flexible web-Application.

the controls shown on the web page need to be changed all the time

Who will change the controls? The client? Can you not just update the .aspx file and publish it to the server every time a control is requested to be changed?

but any way, its an interesting question. There is nothing else really that can be done except using a XML file.

Shezi
  • 1,352
  • 4
  • 27
  • 51
  • Developers are supposed to change the controls according client's request. we want to make this process more modular, instead of modifying the existing code everywhere. – ugoa Jul 09 '12 at 05:45
  • Then i think you should go for XML or a File I/O only. Because otherwise things would get more complicated – Shezi Jul 09 '12 at 06:17