The latest version of ComponentOne Studio for ASP. Wijmo 2013V1 supports MVC4, which includes:
- New MVC 4 Project templates (C # & VB) out-of-the-box MVC 4 project templates are created based on Microsoft built-in templates, and we only optimize the markup and CSS styles for Wijmo style, familiar template layouts and interface styles that will undoubtedly shorten your learning process, Save development time and improve development efficiency.
- New International Theme (Metro)
- MVC4 Template Auto-enhanced Wijmo The MVC scaffolding template will generate default template files for the Add and remove (CRUD) operations in your application, which build the initial project directory structure for your project and, of course, you can modify it, The beauty of the scaffolding template is that you can extend it as you wish after the build.
- wijmo-Enhanced Editor Templates This template allows you to quickly customize your application with date selectors, numeric input boxes, and sliders. You can even add additional custom templates.
start using
To make a MVC4 application using ComponentOne Studio for ASP. Wijmo, the first thing to do is to install Studio for ASP. NET Wijmo.
Test environment VS2012, MVC4, Framework4.5, IE10, Studio for ASP.
FILE-New Project
After you have installed studio for ASP. WIJMO2013V1, select New Project in VS2012. In the Web tab, you can find studio for ASP. Wijmo2013v1.
OK, now let's run the program to see the initial effect. You may be familiar with this interface. Because the Wijmo MVC 4 project template is created based on a Microsoft built-in template. We only optimized the markup and CSS styles for the Wijmo style.
Add a model
Below, let's use the Wijmo MVC scaffolding template to create a simple "todolist". Let's start by adding models. You need to add the following code:
namespace
MVC4Wijmo.Models
{
public
class
ToDoList
{
[Editable(
false
)]
public
int
Id {
get
;
set
; }
[Required]
public
string
Title {
get
;
set
; }
[Display(Name =
"Date Created"
)]
public
DateTime? CreatedAt {
get
;
set
; }
[Range(0, 5), UIHint(
"IntSlider"
)]
public
int Priority {
get
;
set
; }
[Range(0, 1000000)]
public
decimal
Cost {
get
;
set
; }
[DataType(DataType.MultilineText)]
public
string
Summary {
get
;
set
; }
public
bool Done {
get
;
set
; }
[Display(Name =
"Date Completed"
)]
public
DateTime? DoneAt {
get
;
set
; }
public
ICollection<TahDoItem> TahDoItems {
get
;
set
; }
}
public
class
TahDoItem
{
[Editable(
false
)]
public
int
Id {
get
;
set
; }
[Required]
public
string
Title {
get
;
set
; }
[Display(Name =
"Date Created"
)]
public DateTime? CreatedAt {
get
;
set
; }
[Range(0, 5), UIHint(
"IntSlider"
)]
public
int
Priority {
get
;
set
; }
[DataType(DataType.MultilineText)]
public
string
Note {
get
;
set
; }
public int
ToDoListId {
get
;
set
; }
public
ToDoList ToDoList {
get
;
set
; }
public bool
Done {
get
;
set
; }
[Display(Name =
"Date Completed"
)]
public
DateTime? DoneAt {
get
;
set
; }
}
}
|
Creating Controllers and views
Compile the project before adding controllers and views. This will enable the scaffolding template to identify the new model. Now, mail click on the Controllers folder, select "Add Controller", select the option and click "Add".
Scaffolding will automatically generate the controller and add and delete all the views needed to change the application. The biggest bright spot is that these generated files build a starting project directory structure for your project, and of course you can modify it, and the beauty of the scaffolding template is that you can extend it as you wish after it is generated.
Run
Just through the above steps, we have achieved a simple todolist. Switch to the ToDoList page, the application will create a data source for the model, first shown to us is an empty table. We can add a schedule through the Create new Schedule button.
In the CREATE view you will find the standard editorfor Helpers present in front of you. However, we have added a custom edit template to the project. So if you use a type such as date or value, the scaffolding template automatically generates the editor. The following custom editor views:
now we have completed the function of adding and deleting MVC4 application. These generated files build the original project file directory structure for your project, and of course you can modify it, and the beauty of the scaffolding template is that you can extend it as you wish after the build.
Demo Source Download: Tahdomvc4.zip
tool DOWNLOAD Link: Studio for ASP. Wijmo
ASP. MVC4 Getting Started Guide (10): third-party control Studio for ASP. Wijmo MVC4 Tools App