1 / 26

Web Programming

Web Programming. Building ASP.NET Applications. T. Ahlam Algharasi 4 th Level . The Visual Studio IDE. Start page. Websites in Visual Studio. Create a new ASP.NET application. Websites in Visual Studio. The New Web Site window. Websites in Visual Studio.

liona
Télécharger la présentation

Web Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Programming Building ASP.NET Applications T. AhlamAlgharasi 4th Level

  2. The Visual Studio IDE • Start page

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

  4. Websites in Visual Studio • The New Web Site window

  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.

  6. The Visual Studio IDE 2 1 3 4

  7. The Visual Studio IDE

  8. Solution Explorer • It allows you to see the files that are in the web application directory. • ASP.NET File Types

  9. Solution Explorer • ASP.NET File Types

  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.

  11. Toolbox Tabs

  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.

  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. 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.

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

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

  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.

  18. The Coding Model • Inline code Example

  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.

  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:

  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

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

  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.

  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.

  26. Questions

More Related