ASP.net

What is asp.net ?
  • It is a web framework designed and developed by Microsoft. It is used to develop websites, web applications and web services. It provides fantastic integration of HTML, CSS and JavaScript.
  • It was first released in January 2002. It is built on the Common Language Runtime (CLR) and allows programmers to write code using any supported .NET language. ASP.NET is a part of Microsoft .NET Framework.

What is C# ?
  • It is an object-oriented programming language provided by Microsoft that runs on .Net Framework. 
  • With the help of C# programming language, we can develop different types of secured and robust applications, Window applications, Web applications, Distributed applications, Database applications etc.

History of C# ?
  • Anders Hejlsberg is known as the founder of C# language.
  • C# has evolved much since their first release in the year 2002. It was introduced with .NET Framework 1.0.

Features of C# :
Pro's of C# :
  • It integrates well with the Windows. We don't need any special configurations to get a C# program to run in our Windows environment.
  • Easier to read and learn than c++.
  • It has an excellent free IDE (visual c# express).

Con's of C# : 
  • Uses more memory than c++.
  • No good IDE on non-windows.

Setup & Installation of Visual studio :
  • Search for visual studio in google.
       

  • Go to official website and click on free trial.


  • Select the components and click on install.


  • It will download the files.
  • Choose the theme and click on start visual studio.


  • Program to print hello world using visual studio.


  • Program to ask his name and print with current date and time.


Basic concepts in C# : 
Variable : 
  • A variable is a name of memory location. It is used to store data. Its value can be changed and it can be reused many times. 
  • It is a way to represent memory location through symbol so that it can be easily identified.
  • The syntax to declare a variable is type variable_list;  
  • To secure the variables we use the keyword private and to alter those variable we use setter and getter methods.

Call By Value : 
  • Value-type parameters are that pass a copy of original value to the function rather than reference. 
  • It does not modify the original value. A change made in passed value does not alter the actual value.


Call By Reference : 
  • A ref keyword to pass argument as reference-type. It passes reference of arguments to the function rather than copy of original value. 
  • The changes in passed values are permanent and modify the original variable value.


Arrays : 
  • It is a group of similar types of elements that have contiguous memory location. An array index starts from 0. 
  • We can store only fixed set of elements in C# array.
  • EX : int[] arr = new int[5];

static : 
  • static is a keyword that belongs to the type not instance. So instance is not required to access the static members. 
  • In C#, static can be field, method, constructor, class, properties, etc.
  • we don't need to create instance for accessing the static members, so it saves memory. 
  • Moreover, it belongs to the type, so it will not get memory each time when instance is created.

Method Overloading :
  • Having two or more methods with same name but different in parameters, is known as method overloading.
  • It increases the readability of the program because we don't need to use different names for same action.
  • By changing number of arguments and data type of the arguments we can perform method overloading.


Method Overriding :
  • If derived class defines same method as defined in its base class, it is known as method overriding. 
  • It enables us to provide specific implementation of the method which is already provided by its base class.
  • To perform method overriding in C#, we need to use virtual keyword with base class method and override keyword with derived class method.