Web Programming ASP.NET Core Hans-Petter Halvorsen
Total Page:16
File Type:pdf, Size:1020Kb
Web Programming ASP.NET Core Hans-Petter Halvorsen https://www.halvorsen.blog Web Programming ASP.NET Core Hans-Petter Halvorsen 2021 Preface This textbook gives an overview of Web and Web programming in general and with focus on ASP.NET and ASP.NET Core. ASP.NET and ASP.NET Core are web development frameworks created by Microsoft. The only way to learn programming is to do a lot of coding by yourself, and not only small code snippets with a few lines of code. You need to make large Applications. It takes time and may be demanding, but that’s the only way! The reward is knowledge that goes deep, and you will gain skills that is highly desired by the industry. Web Page: ASP.NET: https://www.halvorsen.blog/documents/programming/web/aspnet/ Videos: ASP.NET Core Web Programming YouTube Playlist: https://www.youtube.com/watch?v=lcQsWYgQXK4&list=PLdb- TcK6Aqj34rTHSk6C1jZQgeALWS1qO Here you will find videos that introduces the ASP.NET Core topics covered in this textbook. Other useful YouTube Playlists: C# YouTube Playlist: https://www.youtube.com/watch?v=I6Mq79Dai7M&list=PLdb- TcK6Aqj0fji9OdAI4L9ydhiD3KUX8 Visual Studio YouTube Playlist: https://www.youtube.com/watch?v=3NQAWzatqvA&list=PLdb- TcK6Aqj3pVNwegVKUGoHN3mi6IXjk SQL Server YouTube Playlist: https://www.youtube.com/watch?v=pMGW353gauo&list=PLdb-TcK6Aqj3DCOx- CiG0ddUrUQ86r2Nz Web Programming - ASP.NET Core Database Systems YouTube Playlist: https://www.youtube.com/watch?v=n75iPNrzN- o&list=PLdb-TcK6Aqj0PedGwO7CUI6WBRyia7EQh Information about the author: Hans-Petter Halvorsen The author currently works at the University of South-Eastern Norway. The author has been working with Software Engineering and Industrial IT Projects for more than 20 years. My Web Site: https://www.halvorsen.blog/ You may also scan the QR code below: My YouTube Channel “Industrial IT and Automation”: https://www.youtube.com/IndustrialITandAutomation https://www.halvorsen.blog Table of Contents Preface ............................................................................................................................. 2 Part 1 : Introduction ....................................................................................................... 12 1 Introduction............................................................................................................. 13 1.1 Applications ...................................................................................................... 14 1.1.1 Desktop Applications ...................................................................................................................... 14 1.1.2 Web Applications ............................................................................................................................ 14 1.1.3 Mobile Applications ........................................................................................................................ 15 1.2 .NET .................................................................................................................. 15 1.3 Web ................................................................................................................. 16 2 ASP.NET................................................................................................................... 17 2.1 ASP.NET Web Forms ......................................................................................... 18 2.2 ASP.NET Core with Razor .................................................................................. 18 Part 2 : Visual Studio and C# ........................................................................................... 20 3 Visual Studio............................................................................................................ 21 3.1 Visual Studio macOS ......................................................................................... 22 4 Desktop Applications ............................................................................................... 25 4.1 Windows Forms App ......................................................................................... 25 4.2 WPF Application ............................................................................................... 25 4.3 Universal Applications ...................................................................................... 25 5 C# Programming Language ...................................................................................... 26 5.1 Introduction ..................................................................................................... 26 5.2 Classes .............................................................................................................. 27 5.3 Inheritance ....................................................................................................... 27 5.3.1 Example .......................................................................................................................................... 27 5.4 Polymorphism .................................................................................................. 29 5.4.1 Example .......................................................................................................................................... 29 5.5 Interfaces ......................................................................................................... 29 5.5.1 Example .......................................................................................................................................... 30 Web Programming - ASP.NET Core 5.6 Generics ........................................................................................................... 30 5.7 Additional C# Resources .................................................................................... 31 5.7.1 Windows Forms Appa ..................................................................................................................... 31 Part 3 : Web Fundamentals............................................................................................. 32 6 The Web .................................................................................................................. 33 6.1 Web Programming ............................................................................................ 35 6.2 Client-Server ..................................................................................................... 36 6.3 Web Server ....................................................................................................... 37 6.4 Web Browsers .................................................................................................. 39 6.5 HTML ................................................................................................................ 40 6.6 CSS ................................................................................................................... 41 6.7 JavaScript ......................................................................................................... 41 6.8 Server-side Frameworks .................................................................................... 42 6.8.1 PHP .................................................................................................................................................. 42 6.8.2 ASP.NET........................................................................................................................................... 43 6.8.3 Django ............................................................................................................................................. 43 6.8.4 JavaScript Server-side Frameworks ................................................................................................ 44 6.9 Web Data Formats ............................................................................................ 44 6.9.1 XML ................................................................................................................................................. 44 6.9.2 JSON ................................................................................................................................................ 44 7 HTML ....................................................................................................................... 46 7.1 HTML in Visual Studio ....................................................................................... 47 7.2 HTML Tags ........................................................................................................ 47 7.2.1 Title ................................................................................................................................................. 48 7.2.2 Headers ........................................................................................................................................... 48 7.2.3 Paragraphs ...................................................................................................................................... 48 7.2.4 Hyperlinks ....................................................................................................................................... 48 7.2.5 Images ............................................................................................................................................. 48 7.2.6 Tables .............................................................................................................................................. 49 5 7.2.7 Comments ......................................................................................................................................