Simple ASP.Net programs for beginners

History of ASP.Net :

              ASP.Net is a program that we can use for web application, Desktop Windows application, game development. It is an server-side web  framework designed for web development to produce and developed by Microsoft to permit programmers to create dynamic internet sites , applications and services. It is a modern, general-purpose programming language. January 2002, First released  version of .NET Framework 1.0 is classic ASP.Net and is that the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the basis of the Common Language Runtime (CLR), allowing you to write ASP.NET code using any supported .NET language. ASP.NET is a Simple Object Access Protocol extension framework that allows ASP.NET components to process Simple Object Access Protocol (SOAP) messages.

              .Net is specially designed to work with HTTP and for web developers to create dynamic web pages, web applications, web sites, and web services as it provides a good integration of HTML, CSS, and JavaScript. ASP.NET is a modular web framework, together with other frameworks like Entity Framework. The new framework uses is used to create a variety of applications and services like Console, Web, and Windows, etc. ASP.NET Model View Controller(MVC), ASP.NET Web API, and ASP.NET Websites Pages  (Using only Razor pages) have merged into a unified Model View Controller 6.


              C# is core of ASP.Net framework.It was designed to be general-purpose, high-level, object-oriented, as well as a component-oriented programming language. It was lead by "Anders Hejlsberg" in 2002 and developed by Microsoft within its . NET framework initiative and later approved as a standard by ECMA (ECMA-334) and ISO. C# is a OOPS based programming language. It can be most uses desktop windows applications and game developments.

ASP.NET released Versions :

Versions Number
Release Dates
.Net Frameworks 1.0
January 16, 2002
.Net Frameworks 1.1
April 24, 2003
.Net Frameworks 2.0
November 7, 2005
.Net Frameworks 3.0
November 21, 2006
.Net Frameworks 3.5
November 19, 2007
.Net Frameworks 3.5 Service Pack 1
August 11, 2008
.Net Frameworks 4.0
April 12, 2010
.Net Frameworks 4.5
August 15, 2012
Net Frameworks 4.5.1
October 17, 2013
.Net Frameworks 4.5.2
May 5, 2014
.Net Frameworks 4.6
July 29, 2015
.Net Frameworks 5 RC1
November 18, 2015
.Net Frameworks 4.6.1
November 30, 2015
.Net Frameworks 4.6.2
August 2, 2016
.Net Frameworks 4.7
April 11, 2017
.Net Frameworks 4.7.1
October 17, 2017
.Net Frameworks 4.8
April 18, 2019


C# Version History

VersionsNET FrameworkVisual Studio
Features
C# 1.0
.NET Framework 1.0/1.1
Visual Studio .NET 2002
First release of C#
C# 2.0
NET Framework 2.0
Visual Studio 2005

Generics,
Partial types,
Anonymous methods,
Nullable types,
Iterators,
Covariance and contravarianc
C# 3.0
.NET Framework 3.0\3.5
Visual Studio 2008
Auto-implemented properties,
Anonymous types,
Query expressions,
Lambda expression,Expression trees,
Extension methods
C# 4.0
.NET Framework 4.0
Visual Studio 2010
Dynamic binding,
Named/optional arguments,
Generic covariant and contravariant,
Embedded interop types
C# 5.0
.NET Framework 4.5
Visual Studio 2012/2013
Asynchronous members,
Caller info attributes
C# 6.0
.NET Framework 4.6
Visual Studio 2013/2015
Static imports,Exception filters,
Property initializers,
Expression bodied members Null propagator,
String interpolation,nameof operator,
Dictionary initializer
C# 7.0
.NET Core
Visual Studio 2017
Improved performance and productivity,
Azure Support,AI Support,
Game development,
Cross platform Mobile App Development,
Window App Development


Features to build better applications with ASP.NET

  • Cross-platform & container support
  • High performance
  • Asynchronous via async/await
  • Supports for HTML5 Form Types
  • Security
  • Rich Development Environments
  • Strongly Typed Data Controls
  • Unified MVC & Web API frameworks
  • Dependency Injection
  • Action Filters
  • Extensible Output Caching
  • Globalization and Localization
  • ASP.Net Web API


What is ASP.Net ?

                      ASP.NET stands for Active Server Pages .NET and is developed by Microsoft. ASP.NET is employed to make sites and web technologies and is an integral a part of Microsoft’s .NET framework vision. ASP.NET makes for simple deployment. there's no have to be compelled to register components because the configuration information is built-in.

                   ASP.NET is a basically Web applications,Desktop Windows applications,a comprehensive software infrastructure and various services required to build up robust for computer, as well as mobile devices. ASP.NET applications are compiled codes, written using the extensible and reusable components or objects present in framework. These codes can use the entire hierarchy of classes in .Net framework.


What is C#?

                                C# is core of ASP.Net framework.It was designed to be general-purpose, high-level, object-oriented, as well as a component-oriented programming language. C# is a structured language and produces efficient programs.


Most Important OOPs (Object Oriented Programming System) Concepts


  • Class : A class is a collection of method and variables. It is a blueprint that defines the data and behavior of a type.
        
         Basic Syntax - Example :
          class Employee  
          {
            //Write code
          } 

  • Object : An object are often created by using the new keyword to allocate memory for the category in heap, the thing is named an instance and its starting address will be stored in the object in stack memory.It  is a runtime entity of an object-oriented programing system. 

          Basic Syntax - Example :

           class Employee  
           {
             //Write Code 
            } 
            Employee objEmp = new Employee(); 

  • Method : Methods are generally the block of codes or statements during a program that provides the user the power to reuse an equivalent code which ultimately saves the excessive use of memory, acts as a time saver and more importantly, it provides a far better readability of code.
       
          Basic Syntax - Example :

          namespace Application { 
          class Maths { 
static int Sum(int a, int b) 
int x = a; 
int y = b; 
int result = x + y; 
return result; 

static void Main(string[] args) 
int x = 23; 
int y = 33; 

int c = Sum(x, y); 
Console.WriteLine("The Value of the sum is " + c); 
              } 
           } 


  • Encapsulation : Encapsulation means that we want to hide unnecessary details from the user.Encapsulation is a technique used to protect the information in an object from another object. Hide the data for security such as making the variables private and expose the property to access the private data that will be public.This also allows for abstraction. Within Object Oriented Programs(OOP), encapsulation are often achieved through creating classes. Those classes then display public methods and properties.
       
          Basic Syntax - Example :

          namespace Demo
          {
              public class Bank
                 {
                       private double balance;

                       public double getBalance()
                          {
                              return balance;
                          }

               public void setBalance(double balance)
                 {
                      this.balance = balance;
                 }
            }
           class BankUser
            {
                public static void Main()
                   {
                        Bank SBI = new Bank();
                        SBI.setBalance(500);
                        Console.WriteLine(SBI.getBalance());
                        Console.WriteLine("Press any key to exist.");
                        Console.ReadKey();
                     }
                 }
            }

  • Abstraction : Abstraction means, showcasing only the specified things to the surface world while hiding the main points.Abstraction is very important because it can hide unnecessary details from reference objects to names. it's also necessary for the development of programs. rather than showing how an object is represented or how it works, it focuses on what an object does. Therefore, data abstraction is commonly used for managing large and complicated programs.
     
           Basic Syntax - Example :

             abstract class MobilePhone
             {  
                 public void Calling();  
                 public void SendSMS();  
              }  
             public class Nokia1400: MobilePhone {}  
             public class Nokia2700: MobilePhone
                 {  
                       public void FMRadio();  
                       public void MP3();  
                       public void Camera();  
                   }  
             public class BlackBerry: MobilePhone
                 {  
                      public void FMRadio();  
                      public void MP3();  
                      public void Camera();  
                      public void Recording();  
                      public void ReadAndSendEmails();  
                 }


  • Inheritance : Inheritance is a feature of object-oriented programming that allows code reusability when a class includes property of another class.

           Basic Syntax - Example :

            public class ParentClass {

           public ParentClass() {

           Console.WriteLine("Parent Constructor.");

            }

             public void print() {

             Console.WriteLine("I'm a Parent Class.");

              }

           }

           public class ChildClass: ParentClass {

           public ChildClass() {

           Console.WriteLine("Child Constructor.");

           }

          public static void Main() {

          ChildClass child = new ChildClass();

          child.print();
             }
          }              
         

  • Polymorphism : Polymorphism is method overriding and method overloading. There are two types  compail time and Runtime. 1) Compile time polymorphism means declare a method with same name and different parameter/signature because of this we will perform different tasks with same method name in the same class. 2) Runtime polymorphism means we will declare a method with same name and same parameter/signature in the different class.

          Basic Syntax - Example :

          class Animal
          {
             public void animalSound()
              {
                 Console.WriteLine("The animal makes a sound");
               }
            }

            class Pig : Animal
               {
                 public void animalSound()
                  {
                     Console.WriteLine("The pig says: wee wee");
                   }
                }

           class Dog : Animal
           {
                public void animalSound()
                    {
                           Console.WriteLine("The dog says: bow wow");
                     }
              }

         
  • Constructors : Constructors are class methods that are executed automatically when an object of a given type is made . Constructors usually initialize the information members of the new object. A constructor can run just one occasion when a class is created.
         
          Basic Syntax - Example :

          public class SampleClass
           {
           public SampleClass()
            {
            // Add code here
             }
           }

  • Destructors : The purpose of the destructor method is to remove  of unused objects and resources. Destructors aren't called directly within the source code but during trash collection. garbage collection is nondeterministic. A destructor is invoked at an undetermined moment.

          Basic Syntax - Example :

           namespace oops    
            {    
             class customer    
             {      
              public int x, y;    
           
              customer()    
              {    
               Console.WriteLine("Fields inititalized");    
               x = 10;    
              }    
        
            public void getData()    
             {    
               y = x * x;    
               Console.WriteLine(y);    
             }    
           
             public void Dispose()    
             {    
                 Console.WriteLine("Fields cleaned");    
                  x = 0;    
                  y = 0;    
               }    
              ~customer()    
                {    
                   Dispose();    
                 }    
           
               static void Main(string[] args)    
               {        
                 customer obj = new customer();    
    
                  obj.getData();    
                 }    
              }    
            }


Best ASP.Net Editor tools

  • Microsoft Visual Studio
Download : Click Here
  • Visual Studio Code
Download : Click Here
  • MonoDevelop
Download : Click Here

  • Rider
Download : Click Here
  • Unity - Game Development using ASP.Net
Download : Click Here
  • dotPeek
Download : Click Here