Download .Net Framework and C#, ASP.NET introduction and more Lecture notes Computer Science in PDF only on Docsity!
.NET Framework
Agenda
- (^) Introduction to .Net Framework
- (^) Overview
- (^) Architecture
- (^) Assemblies
- (^) Introduction to C#
- (^) Overview
- (^) My First C# Program
- (^) Interfaces
- (^) Collections
- (^) Exception Handling
- (^) Introduction to ASP.Net
- (^) Life Cycle
- First Web Application using C#
- (^) Validation Controls
- (^) State Management
- (^) Introduction to ADO.NET
- (^) Data Provider
- (^) ADO.NET Objects
- (^) IIS – Web Server
- (^) Overview
- (^) Publish and Deploy an ASP.NET Website
- (^) Introduction to Silverlight
- (^) Introduction to Share point
- (^) Generation of Reports using Crystal Reports
- (^) Hands On
- (^) Creating a windows form application – Matching Game
- (^) Creating a web application – Store Employee Info
Basic architecture of the .Net framework C#, VB.Net, J#.. Languages: .Net framework allows developers to use several programming languages to build below types of applications.
- WinForms –is used for developing Forms-based applications, which would run on an end user machine. Notepad is an example of a client-based application.
- (^) ASP.Net –is used for developing web based applications, which are made to run on any browser such as Internet Explorer, Chrome or Firefox.
- (^) ADO.Net –is used to develop applications to interact with databases such as Oracle or Microsoft SQL Server. Introduction to .Net Framework - Architecture
Libraries:
- (^) .NET Framework includes a set of standard class libraries.
- These class libraries implement many common functions, such as file reading and writing, database interaction, and XML document manipulation.
- (^) The class library is divided into two parts: Base Class Library (BCL) and Framework Class Library (FCL).
- (^) BCL includes a small subset of the FCL. The Classes of BCL reside in mscorlib.dll, System.dll and System.Core.dll.
- (^) FCL is a superset of BCL and refers to the entire class library that ships with .NET Framework. It includes Windows Forms, ASP.NET, Windows Presentation Foundation (WPF), LINQ etc., Introduction to .Net Framework - Architecture CLR (Common Language Runtime):
- (^) CLR is a runtime platform on which the .Net programs are executed.
- (^) Provides services such as memory management, and exception handling Exception Handling - Exception handling, using the CLR, is faster than using the Windows- based C++ error handling. Exception class in CLR is the base class from which all other exception classes are derived. Memory Management - CLR frees the developer from the burden of managing memory using Garbage Collector.
Introduction to .Net Framework - Assemblies
- (^) An assembly in the Common Language Infrastructure (CLI) is a compiled code library used for deployment, versioning, and security.
- (^) .NET assemblies contain IL, whereas pre .NET assemblies contain native code.
- (^) Assemblies contain extension .DLL or .EXE depending on the type of application
- (^) Assembles are categorised in Strong Named Assembly and Weak Named Assembly
- (^) Strong Named Assembly will have a public key token that makes assembly unique
- (^) Weak Named Assembly will not have a public key token and not unique, hence it can be tampered There are 3 types of Assemblies Private Assemblies : Private Assemblies are designed to be used by one application and must reside in that application's directory. Shared Assemblies : Are distributed among multiple applications Satellite Assembly : Using satellite assemblies, you can place resources for different languages in different assemblies, and the correct assembly is loaded into memory only if the user selects to view the application in that language.
Introduction to C# - Overview C# is a simple & powerful object-oriented programming language developed by Microsoft. C# can be used to create various types of applications, such as web, windows, console applications using visual studio. Version .NET Framework Visual Studio Important Features C# 1.0 .NET Framework 1.0/1.1 Visual Studio .NET 2002 • Basic features C# 2.0 .NET Framework 2.0 Visual Studio 2005 • Generics
- Partial types
- Anonymous methods
- Static classes C# 3.0 .NET Framework 3.0\3.5 Visual Studio 2008 • Implicitly typed local variables
- Auto-Implemented properties
- Anonymous types
- Extension methods
- Lambda expressions C# 4.0 .NET Framework 4.0 Visual Studio 2010 • Dynamic binding (late binding)
- Generic co- and contra variance C# 5.0 .NET Framework 4.5 Visual Studio 2012/2013 • Async features
- Caller information C# 6.0 .NET Framework 4.6 Visual Studio 2013/2015 • Expression Bodied Methods
- Auto-property initializer
- Await in catch block
- Exception Filter C# 7.0 .NET Core Visual Studio 2017 • out variables
- Tuples
- Pattern Matching
- throw Expressions Evolution of C#
Introduction to C# - Interface An interface in C# contains only the declaration of the methods, properties but not the implementation. It is left to the class that implements the interface by providing implementation for all the members of the interface. Interface members are public by default.
Introduction to C# - Collections C# includes specialized classes that hold many values or objects in a specific series, those are called ‘Collection'. There are two types of collections available in C#: non-generic collections and generic collection. Every collection class implements the IEnumerable interface so values from the collection can be accessed using a foreach loop. The System.Collections namespace includes following non-generic collections.
Introduction to C# - Exception Handling An application may encounter an error during the execution. When an error occurs, either CLR or program code throws an exception which contains necessary information about the error. There are two main classes for exceptions - SystemException and ApplicationException. SystemException is a base class for all CLR generated errors whereas ApplicationException serves as a base class for all application related exceptions, which you want to raise on business rule violation. The following is a hierarchy of some of the exception classes in .Net
Introduction to C# - Exception Handling Images represent various ways to handle exception (^1 ) 3 4
CLIENT
WEB SERVER
1. The Web browser sends a request 3.Web Server collects the contents (code + HTML) of the web page and parses the contents to produce HTML. 5. Browser processes HTML and displays **page
- The Web Server searches for the requested page
- The HTML stream is sent back to the requesting browser** Dynamic Application Introduction to ASP.Net
- (^) ASP.NET is the successor to Microsoft's Active Server Pages (ASP) technology that was released in 2000
- (^) ASP.NET is now succeeded by ASP.NET Core released in 2016 that is open source
- (^) ASP.NET Web pages, known officially as Web Forms
- (^) Web forms are contained in files with a ".aspx" extension
- (^) Web forms contains markups; markup can include HTML or server-side web controls ex: a textbox is defined as
- (^) ASP.NET supports code-behind model that lets static text remain on the .aspx page, while dynamic code remains in an .aspx.vb or .aspx.cs files Introduction to ASP.Net
Introduction to ASP.Net – First Web Application using C#
Introduction to ASP.Net – First Web Application using C#