ASP. MVC4 Getting Started Guide (10): third-party control Studio for ASP. Wijmo MVC4 Tools App

Source: Internet
Author: User

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:

namespaceMVC4Wijmo.Models{    publicclassToDoList    {        [Editable(false)]        publicintId { get; set; }         [Required]        publicstringTitle { get; set; }        [Display(Name = "Date Created")]        publicDateTime? CreatedAt { get; set; }        [Range(0, 5), UIHint("IntSlider")]        publicint Priority { get; set; }        [Range(0, 1000000)]        publicdecimalCost { get; set; }         [DataType(DataType.MultilineText)]        publicstringSummary { get; set; }        publicbool Done { get; set; }        [Display(Name = "Date Completed")]        publicDateTime? DoneAt { get; set; }         publicICollection<TahDoItem> TahDoItems { get; set; }    }    publicclassTahDoItem    {        [Editable(false)]        publicintId { get; set; }        [Required]        publicstringTitle { get; set; }        [Display(Name = "Date Created")]        public DateTime? CreatedAt { get; set; }        [Range(0, 5), UIHint("IntSlider")]        publicintPriority { get; set; }        [DataType(DataType.MultilineText)]        publicstringNote { get; set; }        public intToDoListId { get; set; }        publicToDoList ToDoList { get; set; }        public boolDone { get; set; }        [Display(Name = "Date Completed")]        publicDateTime? 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.