Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad GM-IT CIIT Islamabad CIIT Virtual Campus, CIIT COMSATS Institute.

Similar presentations


Presentation on theme: "CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad GM-IT CIIT Islamabad CIIT Virtual Campus, CIIT COMSATS Institute."— Presentation transcript:

1 CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad GM-IT CIIT Islamabad CIIT Virtual Campus, CIIT COMSATS Institute of Information TechnologyT2-Lecture-14

2 ASP.NET MVC Part - I For Lecture Material/Slides Thanks to: www.w3schools.com

3 Objectives Introduction MVC Application MVC Folders MVC Layout MVC Controllers MVC Views MVC Database MVC Models T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1-3

4 Introduction

5 Introduction ASP.NET is a development framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting. ASP.NET supports three different development models: 1.Web Pages 2.MVC (Model View Controller) 3.Web Forms. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1-5

6 The MVC Programming Model MVC is one of three ASP.NET programming models. It is a framework for building web applications using a MVC (Model View Controller) design: The Model represents the application core (for instance a list of database records). The View displays the data (the database records). The Controller handles the input (to the database records). The MVC model also provides full control over HTML, CSS, and JavaScript. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1-6

7 The MVC Programming Model The MVC model defines web applications with three logic layers: The business layer (Model logic) The display layer (View logic) The input control (Controller logic) T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1-7

8 The MVC Programming Model The Model: is the part of the application that handles the logic for the application data. The model objects retrieve data (and store data) from a database. The View: is the parts of the application that handles the display of the data. Most often the views are created from the model data. The Controller: is the part of the application that handles user interaction. Typically controllers read data from a view folder, control user input, and send input data to the model. The MVC Model: separation helps you manage complex applications, One can focus on one aspect a time. For example, one can focus on the view without depending on the business logic. It also makes it easier to test an application. It simplifies group development. Different developers can work on the view, the controller logic, and the business logic in parallel. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1-8

9 Web Forms vs MVC The MVC programming model is a lighter alternative to traditional ASP.NET (Web Forms). MVC is a lightweight, highly testable framework, integrated with all existing ASP.NET features, such as Master Pages, Security, and Authentication. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1-9

10 Visual Studio Express 2012/2010 Visual Studio Express is a free version of Microsoft Visual Studio. Visual Studio Express is a development tool tailor made for MVC (and Web Forms). Visual Studio Express contains: MVC and Web Forms Drag-and-drop web controls and web components A web server language (Razor using VB or C#) A web server (IIS Express) A database server (SQL Server Compact) A full web development framework (ASP.NET) T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 10

11 Visual Studio Express 2012/2010 If you want to install Visual Studio Express, click on one of these links: Visual Web Developer 2012 (If you have Windows 7 or Windows 8) Visual Web Developer 2012 Visual Web Developer 2010 (If you have Windows Vista or XP) Visual Web Developer 2010 After you have installed Visual Studio Express the first time, it pays to run the installation one more time, to install fixes and service packs. Just click on the link once more. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 11

12 Internet Application

13 To learn ASP.NET MVC, we will Build an Internet Application We will build an Internet application that supports adding, editing, deleting, and listing of information stored in a database. Part I: Creating the Application Part II: Exploring the Application Folders Part III: Adding Styles and a Consistent Look (Layout). Part IV: Adding a Controller Part V: Adding Views for Displaying the Application Part VI: Adding a Database. Part VII: Adding a Data Model T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 13

14 Part I: Creating the Application Part I: Creating the Application

15 Using visual web Developer Visual Web Developer offers different templates for building web applications. In this lesson we will use Visual Web Developer to create an empty MVC Internet application with HTML5 markup. When the empty Internet application is created, we can gradually add code to the application until it is fully finished. We can use C# as the programming language, with the newest Razor server code markup. Observe the content, the code, and all the components of the application. Note: Don’t panic if you do not understand every thing, the purpose is to have a full run towards application development T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 15

16 Creating the Web Application Start Visual Web Developer and select New Project. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 16

17 Creating the Web Application… In the New Project dialog box: Open the Visual C# templates Select the template ASP.NET MVC 3 Web Application Set the project name to MvcDemo Set the disk location to something like c:\w3schools_demo Click OK When the New Project Dialog Box opens: Select the Internet Application template Select the Razor Engine Select HTML5 Markup Click OK T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 17

18 Creating the Web Application… Visual Studio Express will create a project much like this: T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 18

19 Part-II Exploring the Application Folders

20 MVC Folders T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 20

21 MVC Folders… The folder names are the same in all MVC applications. The MVC framework is based on default naming. Controllers are in the Controllers folder, Views are in the Views folder, and Models are in the Models folder. You don't have to use the folder names in your application code. Standard naming reduces the amount of code, and makes it easier for developers to understand MVC projects. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 21

22 The App_Data Folder The App_Data folder is for storing application data. The Content Folder  The Content folder is used for static files like style sheets (css files), icons and images.  Visual Web Developer automatically adds a themes folder to the Content folder. The themes folder is filled with jQuery styles and pictures.  In this project you can delete the themes folder.  Visual Web Developer also adds a standard style sheet file to the project: the file Site.css in the content folder.  The style sheet file is the file to edit when you want to change the style of the application. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 22

23 The Controllers Folder The Controllers folder contains the controller classes responsible for handling user input and responses. MVC requires the name of all controller files to end with "Controller". Visual Web Developer has created a Home controller (for the Home and the About page) Account controller (for Login pages): T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 23

24 The Models Folder The Models folder contains the classes that represent the application models. Models hold and manipulate application data. The Views Folder The Views Folder  The Views folder stores the HTML files related to the display of the application (the user interfaces).  The Views folder contains one folder for each controller.  Visual Web Developer has created:  Account folder, a Home folder, and a Shared folder (inside the Views folder).  The Account folder contains pages for registering and logging in to user accounts.  The Home folder is used for storing application pages like the home page and the about page.  The Shared folder is used to store views shared between controllers (master pages and layout pages). T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 24

25 The Scripts Folder The Scripts folder stores the JavaScript files of the application. By default Visual Web Developer fills this folder with standard MVC, Ajax, and jQuery files: Note: The files named "modernizr" are JavaScript files used for supporting HTML5 and CSS3 features in the application. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 25

26 Part III: Adding Styles and a Consistent Look (Layout).

27 Adding a Layout The file _Layout.cshtml represent the layout of each page in the application. It is located in the Shared folder inside the Views folder. Open the file and swap the content with this: HTML helpers are used to modify HTML output: @Url.Content() - URL content to be inserted. @Html.ActionLink() - HTML link to be inserted. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 27

28 Razor Syntax In the code above, the code marked red are C# using Razor markup. @ViewBag.Title - The page title to be inserted there. @RenderBody() - The page content to be rendered there. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 28

29 Adding Styles The style sheet for the application is called Site.css. It is located in the Content folder. Open the file Site.css and swap the content with the contents given in the next slide: T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 29

30 T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 30

31 The _ViewStart File The _ViewStart file in the Shared folder (inside the Views folder) contains the following content: @{Layout = "~/Views/Shared/_Layout.cshtml";} This code is automatically added to all views displayed by the application. If you remove this file, you must add this line to all views. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 31

32 Part IV: Adding a Controller

33 The Controllers Folder The Controllers Folder contains the controller classes responsible for handling user input and responses. MVC requires the name of all controllers to end with "Controller". In our example, Visual Web Developer has created the following files: HomeController.cs (for the Home and About pages) and AccountController.cs (For the Log On pages): T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 33

34 The Controllers Folder Web servers will normally map incoming URL requests directly to disk files on the server. For example: a URL request like "http://www.w3schools.com/default.asp" will map directly to the file "default.asp" at the root directory of the server. The MVC framework maps differently. MVC maps URLs to methods. These methods are in classes called "Controllers". Controllers are responsible for processing incoming requests, handling input, saving data, and sending a response to send back to the client. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 34

35 The Home controller The controller file in our application HomeController.cs, defines the two controls Index and About. Swap the content of the HomeController.cs file with this: T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 35

36 The Controller Views The files Index.cshtml and About.cshtml in the Views folder defines the action (containing relevant data ) ActionResult views Index() retrieves Index.cshtml ActionResult views About() retrieves About.cshtml in the controller. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 36

37 Part V: Adding Views for Displaying the Application.

38 The Views Folder The Views folder stores the files (HTML files) related to the display of the application (the user interfaces). These files may have the extensions html, asp, aspx, cshtml, and vbhtml, depending on the language content. The Views folder contains one folder for each controller. Visual Web Developer has created an Account folder, a Home folder, and a Shared folder (inside the Views folder). The Account folder contains pages for registering and logging in to user accounts. The Home folder is used for storing application pages like the home page and the about page. The Shared folder is used to store views shared between controllers (master pages ; Title, menue, and layout pages). T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 38

39 ASP.NET File Types The following HTML file types can be found in the Views Folder: T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 39

40 The Index File The file Index.cshtml represents the Home page of the application. It is the application's default file (index file). Put the following content in the file: @{ViewBag.Title = "Home Page";} Welcome to W3Schools Put Home Page content here T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 40

41 The About File The file About.cshtml represent the About page of the application. Put the following content in the file: @{ViewBag.Title = "About Us";} About Us Put About Us content here T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 41

42 Run the Application Select Debug, Start Debugging (or F5) from the Visual Web Developer menu. Your application will look like this: Click on the "Home" tab and the "About" tab to see how it works. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 42

43 Your First Application has launched Congratulations. You have created your first MVC Application. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 43

44 Part VI: Adding a Database.

45 Creating the Database Visual Web Developer comes with a free SQL database called SQL Server Compact. The database needed for this lesson can be created with these simple steps : Right-click the App_Data folder in the Solution Explorer window Select Add, New Item Select SQL Server Compact Local Database * Name the database Movies.sdf. Click the Add button T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 45

46 Creating the Database Visual Web Developer automatically creates the database in the App_Data folder. If SQL Server Compact Local Database is not an available option, means SQL Server Compact not installed. If SQL Server Compact not installed on your computer. Install it from this link: SQL Server Compact T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 46

47 Adding a Database Table Double-clicking the Movies.sdf file in the App_Data folder will open a Database Explorer window. To create a new table in the database, right-click the Tables folder, and select Create Table. Create the following columns: T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 47

48 Adding a Database Table ID is an integer (whole number) used to identify each record in the table. Title is a 100 character text column to store the name of the movie. Director is a 100 character text column to store the director's name. Date is a datetime column to store the release date of the movie. After creating the columns described above, you must make the ID column the table's primary key (record identifier). To do this, click on the column name (ID) and select Primary Key. Also, in the Column Properties window, set the Identity property to True: T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 48

49 T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 49

50 Adding a Database Table When you have finished creating the table columns, save the table and name it MovieDBs. Note: ◦ We have deliberately named the table "MovieDBs" (ending with s). ◦ Later we will the name "MovieDB" used for the data model. ◦ It looks strange, but this is the naming convention you have to use to make the controller connect to the database table. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 50

51 Adding Database Records Use Visual Web Developer to add some test records to the movie database. Double-click the Movies.sdf file in the App_Data folder. Right-click the MovieDBs table in the Database Explorer window and select Show Table Data. Add some records: Note: The ID column is updated automatically. You should not edit it. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 51

52 Part VII: Adding a Data Model. MVC Models

53 Models The MVC Model contains all application logic: business logic, validation logic, data access logic, (except pure view and controller logic.) MVC, models are used to both: Hold and manipulate application data. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 53

54 The Models Folder The Models Folder contains the classes that represent the application model. Visual Web Developer automatically creates an AccountModels.cs file that contains the models for application security. AccountModels contains: ◦ A LogOnModel, ◦ A ChangePasswordModel, and ◦ A RegisterModel. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 54

55 Adding a Database Model The database model needed for this Lesson can be created with these simple steps: In the Solution Explorer, right-click the Models folder, select Add and Class. Name the class MovieDB.cs, and click Add. Edit the class: T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 55

56 T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 56

57 Adding a Database Model Note: We have deliberately named the model class "MovieDB". In the previous section, we used the name "MovieDBs" (ending with s) used for the database table. It looks strange, but this is the naming convention we have to use to make the model connect to the database table. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 57

58 Adding a Database Controller The database controller needed for this lesson can be created with these simple steps: Re-Build your project: Select Debug, and then Build MvcDemo from the menu. In the Solution Explorer, right-click the Controllers folder, and select Add and Controller Set controller name to MoviesController Select template: Controller with read/write actions and views, using Entity Framework Select model class: MovieDB (MvcDemo.Models) Select data context class: MovieDBContext (MvcDemo.Models) Select views Razor (CSHTML) Click Add T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 58

59 Adding a Database Controller Visual Web Developer will create the following files: A MoviesController.cs file in the Controllers folder A Movies folder in the Views folder T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 59

60 Adding Database Views The following files are automatically created in the Movies folder: Create.cshtml Delete.cshtml Details.cshtml Edit.cshtml Index.cshtml T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 60

61 Adding a Connection String Add the following element to the element in your Web.config file: T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 61

62 MVC Application Security The Models Folder contains the classes that represent the application model. Visual Web Developer automatically creates an AccountModels.cs file that contains the models for application authentication. AccountModels contains a LogOnModel, A ChangePasswordModel, and A RegisterModel: T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 62

63 Account Model T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 63

64 The Change Password Model public class ChangePasswordModel { [Required] [DataType(DataType.Password)] [Display(Name = "Current password")] public string OldPassword { get; set; } [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "New password")] public string NewPassword { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm new password")] [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] public string ConfirmPassword { get; set; } } T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 64

65 A Logon Model public class LogOnModel { [Required] [Display(Name = "User name")] public string UserName { get; set; } [Required] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [Display(Name = "Remember me?")] public bool RememberMe { get; set; } } T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 65

66 The Register Model public class RegisterModel { [Required] [Display(Name = "User name")] public string UserName { get; set; } [Required] [DataType(DataType.EmailAddress)] [Display(Name = "Email address")] public string Email { get; set; } [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm password")] [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] public string ConfirmPassword { get; set; } } T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 66

67 Congratulations Congratulations. You have added your first MVC data model to your application. Now you can click on the "Movies" tab T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 67

68 Internet Application To learn ASP.NET MVC, we will Build an Internet Application We will build an Internet application that supports adding, editing, deleting, and listing of information stored in a database. Part I: Creating the Application Part II: Exploring the Application Folders Part III: Adding Styles and a Consistent Look (Layout). Part IV: Adding a Controller Part V: Adding Views for Displaying the Application Part VI: Adding a Database. Part VII: Adding a Data Model T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 68

69 The End ASP.NET MVC T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 69

70 Introductionto Visual Studio 2010 T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 70

71 Installation of Visual Studio/Visual Web Express Get and install a licensed copy of either the Visual Studio or Visual Web Developer. Visual Web Developer 2010 Express is part of the Visual Studio family. So, either of the environments can be used to build Web sites without any issue. Lets have introduction to Visual Studio 2010 environment. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 71

72 Starting Visual Studio/Web Developer Run Visual Studio from the installed directory or Desktop or Start Menu. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 72

73 Adding Projects and Items Web Projects The New Web Site dialog box enables you to create a new Web site on the local computer or on a remote computer, or to connect to a Web site location using FTP to read and write files. The following illustration shows the New Web Site dialog box. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 73

74 Using the Integrated Development Environment The Visual Web Developer environment T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 74

75 Customizing Menus and Toolbars The menus and toolbars in Visual Web Developer are customizable. To customize menus commands and toolbars, click Customize in the Tools menu. Customize dialog box The Customize dialog box lets you select toolbars to display, create custom toolbars and menus, add and remove items from toolbars and menus, and change the appearance of toolbar and menu items. Using the Integrated Development Environment T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 75

76 Using the Integrated Development Environment Solution Explorer Window ◦ The Solution Explorer window displays solutions, projects, and the items in those projects. ◦ It provides an organized view of the projects and their files as well as access to the commands that pertain to them. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 76

77 Using the Integrated Development Environment Properties Window ◦ Used to view and set the properties and events of objects that you are working with in the editor and page designer. ◦ Can also be used to edit and view file, project, and solution properties. To display the Properties window, click Properties Window in the View menu. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 77

78 Editors, Designers, and Tools Pages are created and code is written using an editor and using designer windows. The functionality of the editor and of designers depends on the type of file or document being created. Web page editors and designers have two views: ◦ Graphical Design View ◦ Source-code View T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 78

79 Editors, Designers, and Tools Web page designer, design view Design view displays the controls and other items in a WYSIWYG- like way. WYSIWYG: What You See Is What You Get. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 79

80 Editors, Designers, and Tools Web page designer, Source view Source view displays the source code for the file. Source view also supports editing features like word wrap, bookmarks, and line numbers. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 80

81 Editors, Designers, and Tools Web page designer, Split view Some editors can also display the design view and source view at the same time. This view is called Split view. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 81

82 Editors, Designers, and Tools Editing Web Pages in the Designer An ASP.NET Web page consists of visual elements and programming logic. Visual elements for the page include markup, server controls, and static text. Programming logic for the page includes event handlers and other code. The Toolbox displays controls that can be added to Visual Web Developer projects. To display the Toolbox, click Toolbox in the View menu. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 82

83 CSS Properties and Styles The CSS Properties window is used during the editing of an ASP.NET Web page. The window shows the styles that are used by the current selection in a Web page and the order of precedence for the styles. The window is used to add properties to an existing style, modify the already set properties, and create new inline styles. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 83

84 Build and Debug Options Before a Web application can be displayed, it must be compiled, or built. Visual Web Developer provides a robust set of build (compilation) and debugging options. By using build configurations, the components to build can be selected, or those unwanted can be excluded, and built details can be specified. Build configurations for solutions and projects can be created. Building begins the debug process. Building application helps in the detection of compile- time errors. These errors can include incorrect syntax, misspelled keywords, and type mismatches. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 84

85 The Output window displays these types of errors. Output window showing build information Build and Debug Options T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 85

86 After building the application, the debugger can be used to detect and correct run-time problems, such as logic errors. The code can be stopped (break) as it is running. In break mode, the local variables and other data can be examined by using tools such as the Variable window, the Quick Watch dialog box, and the Memory windows. Build and Debug Options T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 86

87 Debugging windows The Error List window displays errors, warnings, and other messages that are related to debugging. Build and Debug Options T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 87

88 Deployment Options Web Site Project Deployment The typical Web deployment scenarios for Web site projects include: ◦ Deploying a Web site by using the Copy Web Site tool, which can copy and synchronize files between the source computer, a destination computer or location. ◦ Deploying a Web site by using the Windows XCopy command. ◦ Deploying a prebuilt (precompiled) Web site. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 88

89 Product Documentation The Help can be accessed by pressing F1 in the IDE and by clicking View Help in the Help menu. Help can be obtained from either locally installed Help or documentation on the MSDN Web site. T2-Lecture-14 Ahmed Mumtaz Mustehsan www.w3schools.com 1- 89

90 End ASP.NET MVC Part - I For Lecture Material/Slides Thanks to: www.w3schools.com


Download ppt "CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad GM-IT CIIT Islamabad CIIT Virtual Campus, CIIT COMSATS Institute."

Similar presentations


Ads by Google