I want to create a page that allows users to choose how they would like to see their data - that is Summary (group (which supports clinging), grid (which supports climbing), tables (which supports cloaking), map, time line, XML, JSN etc.
Now Different uses of each layout will be a different visual model, which is a common base class / The reason for achieving from the model is because each layout requires an object structure, which deal with it separately (some others need to be sorted.)
Each layout is the same The repository will call the method and each layout will support the same functionality, i.e. search and filtering (so these controls will be shared between layouts).
Now my question is given to what people think is the best way
- Using DisplayFor to handle different types of presentations?
- In addition to how I work with this task ... I think I will use an action, and pass through the layout types, but then how it supports the grouping for the summary Grid and table view
- Do I consider each group as just one layout type
- In addition to how it will work from the URL perspective - people think that This layout functionality The template to support is
Cheers Anthony
Conceptual As part of, see part of an MVC is the web app that is responsible for displaying data, therefore, if you want to display the data in different ways, it seems logical that each "display" has its own self See ASPX
All visual models can be obtained from the same base model. For example, we may have four models and three ideas:
public intangible class basemodel {} public class GridViewModel: baseviewmodel {} public class tableview model: baseviewmodel {} public class summary viewmodel : BaseViewModel {} GridViewPage & lt; GridViewModel & gt; TableViewPage & LT; TableViewModel & gt; SummaryViewPage & LT; SummaryViewModel & gt;
Different stylesheet and javascript files may be attached in each view, so if you want you should be able to use the display application, or you can create layout by hand .
For the controller, you can create an action method that returns any of the three scenes, or you can create a different three different ActionResults for each view here "monolithic" Action ring:
Public Action Result PageViewResult (String Page Type) {switch (type of page) {// Define your cases, return your ideas and make your model // a default Be sure to set up}}
You can format routes, though you can see fit. For example, with the above "monolithic" action result, we can make the following routes in our Global.asax file:
routes.MapRoute ("FormattedViewPage", // Route name "View / Page / {PageType} ", // URL with new parameters {controller =" viewpage controller ", action =" pageviewslt ", pagetype =" grid "} // parameter defaults);
Hope it helps me tell me if you have any questions.
Comments
Post a Comment