start using
To make a MVC5 application using ComponentOne Studio for ASP. Wijmo, the first thing to do is to install Studio for ASP. NET Wijmo.
Test environment VS2013, MVC5, Framework4.5, IE11, Studio for ASP.
FILE-New Project
After you have installed studio for ASP. WIJMO2014V1, select New Project in VS2012. In the Web tab, you can find studio for ASP. Wijmo 2014V1.
Views| created in the Under Shared, open _layout.cshtml. The template adds Wijmo controls such as menus, buttons, check boxes, simple input boxes, and so on. Find <ul class= "Nav navbar-nav" >, replaced by the following code:
@Html. ActionLink ("Home", "Index", "Home") @Html. ActionLink ("Add List", "Create", "Tahdolist") @Html. ActionLink ("About", " About "," Home ")
OK, now let's run the program to see the initial effect. You may be familiar with this interface. Because the Wijmo MVC 5 project template is created based on a Microsoft built-in template. We optimized the markup and CSS style for Wijmo style.
Add a model
Below, create a poco (Plain old CLR Objects) model for Tahdolist and Tahdoitem. You need to add a new class in the Models folder, named ToDo.cs, and add the following code:
public class Tahdolist{[editable (false)]public int Id {get; set;} [Required] [Display (Name = "title")]public string title {get; set;} [Display (Name = "Date Created")]public DateTime? Createdat {get; set;} [Range (0, 5), UIHint ("Intslider")] [Display (Name = "precedence")]public int priority {get; set;} [Range (0, 1000000)] [Display (Name = "spend")]public decimal cost {get; set;} [DataType (Datatype.multilinetext)] [Display (Name = "Digest")]public string Summary {get; set;} [Display (Name = "Finish date")]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 Tahdolistid {get; set;} Public tahdolist tahdolist {get; set;} [Display (Name = "Finish date")]public DateTime? DoneAt {get; set;}}
Creating Controllers and views
Next, add the controller for Tahdolist and Tahdoitem. Right click on the Controllers folder, select "Add Controller", select the option and click "Add". Name is Tahdolistcontroller. Then select the following settings in the template's Scaffolding Options window:
Click Add,visual Studio to generate all the things you need.
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 pass the lists| The Add List button adds a schedule.
After completing, click Create to enter the index page.
now we have completed the function of adding and deleting MVC5 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.
example Download link : tahdo.zip
Tool Download Link : Studio for ASP. Wijmo
The 12 articles in the ASP. NET MVC 5 Getting Started Guide are summarized below:
1. asp 5-Start MVC 5 Tour
2. ASP. NET MVC 5-Controller
3. ASP. NET MVC 5-View
4. asp 5-pass data from the controller to the view
5. ASP. 5-Add a model
6. asp 5-Create a connection string (Connection string) and use SQL Server LocalDB
7. ASP. 5-access the data model from the controller
8. ASP. 5-Validation editing method and edit view
9. asp 5-Add new fields to movie tables and models
ASP. NET MVC 5-Add a validator to the data model
ASP. NET MVC 5-query details and Delete methods
ASP. NET MVC 5-Create an app with the Wijmo MVC 5 template for 1 minutes
Hopefully these articles will be helpful to interested friends, plus a PDF version of the summary document:
The ASP. NET MVC 5 Starter Guide PDF version
Go ASP. NET MVC 5– 1 minutes using WIJMO MVC 5 template to create an app