Post on 16-Apr-2017
transcript
by Bogdan GrynkoSoftServe Inc.
ASP.NET MVC
Thin clients: ASP.NET ASP.NET MVC
Select technology
Launched in 2007 Code released under the Microsoft Public License Based on ASP.NET (integrated with existing
ASP.NET features) Composed from three
roles: Model, View and Controller Lightweight Highly testable
ASP.NET MVC
Full control over html Enables TDD Easy integrate with JavaScript Following the design of stateless
nature of the web RESTful urls that enables SEO No ViewState and PostBack events
What under ASP.NET MVC? http://break.com/ http://townhall.com/ http://gamefly.com/ http://stackoverflow.com/ http://www.marketwatch.com/ http://dimecasts.net/ http://tfspreview.com/ http://webcrawler.com/
Advantages
Be successful
Visual Studio up 2008(if 2008 addition package needs to be installed )
MS SQL Server (if it is planned to use MS storage for data)
Get the tools
Create solution
Setup UT
Review solution
Review solution structure
Create DB
Add new table
Create columns
Add ORM Step1
Add ORM Step2:
Adding ORM Step3:
Web.config:
Create Posts Data Models
CreateMessage
Repository Service
Part1
CreateMessage
Repository Service
Part2
Create Blog Controller
Step1
Create Blog Controller
Step2
Review created controller
Create Index Blog View
Step1
Create Index Blog View
Step2
Review created view
Fill Index Blog View
Step4
Create Text Post
Template ViewStep1
Create Text Post
Template ViewStep2
Create Text Post
Template ViewStep3
Create Text Post Partial
ViewStep4
CreatePicture PostPartial View
Add Text Partial View
Step1
Add Text Partial View
Step2
Add Text Partial View
Step3
Add Picture Partial View
Add selection change script to Blog Index view
Fill Blog Controller
Part1
Fill Blog Controller
Part2
Deploy solution
1. In Visual Studio, open the project that you want to deploy.2. In Solution Explorer, expand the References node.3. Select the following assemblies:
1. System.Web.Mvc2. System.Web.Routing3. System.Web.Abstractions
4. In the Properties window, set Copy Local to True.5. In Solution Explorer, right-click the project and click Publish.6. The Publish Web dialog box is displayed.7. In Target location (http:, ftp:, or disk path), browse to a local folder and click Open.8. Select either Replace matching files with local copies or Delete all existing files prior to publish.9. Under Copy, select one of the following, depending on your needs: Only files needed to run this application, All project files, or All files in the source project folder.10. If your application contains files in the App_Data folder such as database files, select Include files from the App_Data folder.11. Click Publish.