Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 12, 2012 12:52 PM by akfkmupiwu
Apr 09, 2012 07:06 AM|LINK
We are developing web application based on ASP.net with MVC3. Our requirement is to compose/present a page dynamically based on a configuration saved by Administrator. We need to load multiple components (in our case partial views) dynamically for a module/screen.
as per configuration (Deployment for a customer). The configuration file will look like.
All these three will be construct a screen/page.
We are using partial views for each component and render logic is written in controller. We are using StructuredMap to achieve this for dependency injection. Please suggest better the approach if we are in wrong direction.
All comments are welcome.
Apr 09, 2012 05:03 PM|LINK
This is good as per your requirement and I don't see any need to change anything. Except couple of question...
- Are you creating a new view for each client, even though the views differ in only couple of fields
- Do you create a view1 and view2, if both view1 and view2 has all the fields same except one. If yes wont' this create a huge collection of almost similar views even though individual elements hardly differ.
- Are there any sort of validation or business rules changes across almost similar views?
Hope these questions are valid in this context..
Apr 10, 2012 06:23 AM|LINK
Thanks a lot Rajesh,
Your questions are very valid.
Yes we are planning to create new views even for small changes like adding/removing of single field. As deployment team needs to pick from these the best suited for a new client.
Yes Business rules may be changed, as per very initial requirement from BA team, this also forced us to take new view for each component.
Apr 12, 2012 12:52 PM|LINK
On top of this we are also using a static version control class for loading the user associated views
public class BMCsController : Controller
BMCList bm = new BMCList();
BMCDB bd = new BMCDB();
public ActionResult Index()
bm = bd.GetBMCs(5);
//using static class VersionControl to get components for user
return View(VersionControl.GetComponent(HttpContext.User.Identity.Name, ComponentName.RangePlanConfigSelection), null, bm);