Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to ASP.NET T.Ahlam Algharasi. The Visual Studio IDE Start page 2.

Similar presentations


Presentation on theme: "Introduction to ASP.NET T.Ahlam Algharasi. The Visual Studio IDE Start page 2."— Presentation transcript:

1 Introduction to ASP.NET T.Ahlam Algharasi

2 The Visual Studio IDE Start page 2

3 Websites in Visual Studio Create a new ASP.NET application. 3

4 Websites in Visual Studio The New Web Site window 4

5 Websites in Visual Studio The New Web Site window allows you to specify three details: – Template: The template determines what files your website starts with. Visual Studio supports two types of basic ASP.NET applications: web site applications and web service applications. – Location: The location specifies where the website files will be stored. – Language: The language identifies the.NET programming language you’ll use to code your website. 5

6 The Visual Studio IDE 6 2 1 3 4

7 7 DescriptionWindows Lists the files and subfolders that are in the web application folder. Solution Explorer Shows ASP.NET’s built-in server controls and any third- party controls or custom controls that you build yourself and add to the Toolbox. Controls can be written in any language and used in any language. Toolbox Allows you to configure the currently selected element, whether it’s a file in the Solution Explorer or a control on the design surface of a web form. Properties Reports on errors that Visual Studio has detected in your code but that you haven’t resolved yet. Error List

8 Solution Explorer It allows you to see the files that are in the web application directory. ASP.NET File Types 8 DescriptionFile These are ASP.NET web pages.They contain the user interface and, optionally, the underlying application code. Ends with.aspx These are ASP.NET user controls. User controls are similar to web pages, except that they can’t be accessed directly. User controls allow you to develop an important piece of the user interface and reuse it in as many web forms as you want without repetitive code. Ends with.ascx

9 Solution Explorer ASP.NET File Types 9 DescriptionFile This is the XML-based configuration file for your ASP.NET application. It includes settings for customizing security, memory management, and much more. web.config These are ASP.NET web services. Web services work differently than web pages, but they still share the same application resources, configuration settings, and memory. Ends with.asmx These are code-behind files that contain vb code. They allow you to separate the application from the user interface of a web page. Ends with.vb

10 Solution Explorer “App_Data” Folder – This directory is reserved for data storage, including database files, XML files, and other data store files. Of course, you’re free to store data files in other directories. 05.10

11 Toolbox Tabs 11 DescriptionTab This tab includes the rich web server controls that are the heart of ASP.NET’s web form model. Standard These components allow you to connect to a database.Data These controls allow you to verify an associated input control against user-defined rules. For example, you can specify the input can’t be empty, it must be a number, it must be greater than a certain value, and so on. Validation These controls are designed to display site maps and allow the user to navigate from one page to another. Navigation These controls provide prebuilt security solutions, such as login boxes and a wizard for creating users. Login

12 Toolbox Tabs You can customize both the tabs and the items in each tab. – To modify the tab groups, right-click a tab heading, and select Rename Tab, Add Tab, or Delete Tab. – To add an item, right-click the blank space on the Toolbox, and Select Items. You can also drag items from one tab group to another. 12 DescriptionTab This tab allows you to drag and drop static HTML elements.HTML Provides a repository for code snippets and control objects. Just drag and drop them here, and pull them off when you need to use them later. General

13 Code Debugging To test this page, select Debug ➤ Start Debugging from the menu. Because this is the first time running any page in this application, Visual Studio will inform you that you need a configuration file that specifically enables debugging Click OK to add this configuration file. 13 ASP.net Server

14 The Coding Model Visual Studio supports two models for coding web pages and web services: – Code-behind This model separates each ASP.NET web page into two files: an.aspx markup file with the HTML and control tags, and a.vb code file with the source code for the page. This model provides better organization important when building complex pages. 14

15 The Coding Model Code-behind Example “Default.aspx” Page 15

16 The Coding Model Code-behind Example “Default.aspx.vb” Page 16

17 The Coding Model – Inline code This model is the closest to traditional ASP. All the code and HTML is stored in a single.aspx file. The code is embedded in one or more script blocks. it’s popular for coding simple web pages. 17

18 The Coding Model Inline code Example 18

19 Choosing the coding model When you add a new web page to your website (using Website ➤ Add New Item), the Place Code in a Separate File check box chooses whether you want to use the code-behind model or not. 19

20 Web Forms The term used to describe an ASP.NET web page is web form. – The basic structure of a web form is shown here: 20

21 Controls

22 Server Controls Server controls – are a fundamental part of the ASP.NET architecture. – are tags that are understood by the server. There are three kinds of server controls: – HTML Server Controls - Traditional HTML tags – Web Server Controls - New ASP.NET tags – Validation Controls - For input validation 22

23 Server Controls HTML Server Controls – HTML server controls are standard HTML tags and are declared with the runat="server" attribute. – The runat="server" attribute indicates that the form should be processed on the server. 23

24 Server Controls Web Server Controls – These classes duplicate the functionalities of the basic HTML tags but have a more consistent and meaningful set of properties and methods that make it easier for the developer to declare and access them. 24

25 Server Controls Validation Controls – are used to validate user-input. For Example If the user- input does not pass validation, it will display an error message to the user. 25

26 Questions 05.26


Download ppt "Introduction to ASP.NET T.Ahlam Algharasi. The Visual Studio IDE Start page 2."

Similar presentations


Ads by Google