AWP
AWP
Unit 2
// ad rotator control
// Validation control
// Calender control
A Calendar control is a tool used in web development to manage and display dates interactively.
It's often used in applications where date-related information needs to be organized, such as
scheduling or event management systems.
• Features
There are various formats of calender are available you can click on autoformat to choose any
other format.
The control displays a calendar in which users can move to any day in any year.
Clicking on a date highlights it.
You can also customise the highlighting colour for a selected date.
You can customize cells to show details and other informations like appointments or tasks of
that day.
// Event handler
Now, in ASP.NET web programming, you often want your web page to respond to these events.
This is where event handlers come in. An event handler is a piece of code that gets executed in
response to a specific event.
To add an event handler in ASP.NET using Visual Studio, you have three ways:
1. **Type it in manually:**
- You write the code for the event handler directly in your C# code file. Specify the necessary
parameters for the event.
So, in a nutshell, an event is something that happens (like a click), and an event handler is the
code that responds to that happening. You can add event handlers by typing them manually,
double-clicking controls, or selecting events from the Properties window.
AutoPostBack is use to reload the page automatically when a certain event is triggered
isPostBack is use to identify whether the page is loaded for the first time or it is reload it will
return Boolean value.
// list controls
( Read and write on OWN )
( Shikshak Pdf answer 19 )
Lists are generally used when a number of options you want to provide to the user
Unit 1
// Foreach loop
The foreach loop is a control flow statement used to iterate over elements in a collection, such
as arrays or lists.
Syntax :
https://www.geeksforgeeks.org/c-sharp-foreach-loop/amp/
(Example* in practical)
» Abstract Class
» Interface
• Interface cannot have access modifiers on its members they're bydefault public
• All the methods in Interface are abstract.
• A class can inherit multiple interfaces at the same time.
• An Interface cannot contain feilds.
• An interface is defined using a keyword 'interface'
• ex, public interface interface_name
{
void method_name();
}
// Namespace & About System Namespace
The Namespace is a keyword, used to declare a scope that contains a set of related objects.
System Namespace
• Explain in own
(like widely used, most common etc)
• Why we use
• Some common classes in System Namespace
( Console, String, Math, DateTime, IO )
• syntax
• Simple Console.WriteLine example
An Assembly is a collection of code files that are compiled into an executable (.exe) or a
Dynamic Link Library (.dll).
» Public Assembly
• A public assembly is intended to be shared and used by multiple applications or projects.
• It is placed in Global Assembly Cache (GAC).
• They can be accessed by any application in a system.
• Shared assembly require special configuration and installation.
• They need to be registered with the GAC using 'gacutil.exe'.
» Private Assembly
• A private assembly is intended to be used by a single application or project.
• It is not placed in Global Assembly Cache (GAC).
• They cannot be accessed by other application.
• Private assembly are simple to deploy and use.
• They're automatically loaded by the .NET runtime when the application starts.
// Access Modifiers
For Reference↓
( https://youtu.be/aAEcoKY wD8I )
NOTE:
• Classes are only internal (bydefault) OR public
• Members are private (bydefault)
• A project is an assembly
// Jagged Array
Jagged array is a array of arrays such that member arrays can be of different sizes.
There are 3 emloyees in a company who have name mark, sam, tom.
Mark have 3 degrees
Sam have 1 degrees
Tom have 2 degrees
It is a virtual machine that provide a common platform to run an application that was built using
the different language such as C#, C++, VB.NET, etc.
1. Languages
• .NET Compliant languages are programming languages like C#,VB.NET,F# etc that follow the
rules and guidelines set by the Common Language Infrastructure (CLI), Allowing developers to
choose their preferred language for building .NET applications.
3. Different Projects
• Visual Studio allow us to work on different project like Web Services, Web forms, Windows
forms.
5. BCL
• BCL is also called as Framework Class Liabrary (FCL).
• The BCL is Base Class Liabrary it is a collection of classes that provide essential
functionalities for .NET applications.
• It includes classes for file I/O, networking, string manipulation, collections, threading, and
more.
• BCL is the core library for common programming tasks.
6. CLR
• CLR is a Common Language Runtime.
• The CLR is the execution engine of the .NET Framework.
• It manages the execution of .NET applications, including memory management, security, and
JIT compilation.
• It ensures that .NET applications run safely and efficiently on Windows operating systems.
(Diagram↓)
https://www.javatpoint.com/vb-net-dot-net-framework-introduction
Note:
• FCL = BCL
// Constructor Types
• Default
• Parameterized
• Copy
• Static
• Private
// Multiple Inheritance
Properties are the special type of class members that provides a flexible mechanism to read,
write, or compute the value of a private field.
• Read/Write property
A property(function) with both get and set accessors
• Read Only Property
Only get accessor
• Write Only Property
Only set accessor
• Auto Implemented property
Ex, public void func_name{get; set;}
set{name=value;}
get{return this.private_var;}
• Value
• Reference
• Out
• Parameter arrays
Two types↓
SingleCast Delegate: A delegate refers to a single function or method.
MultiCast Delegate: A delegate refers to a multiple functions or methods.
//Boxing and Unboxing
Example↓
// Unboxing
int unboxedValue = (int)boxedValue; // Unboxing occurs here
//Math Functions
(Refer practical*)
// Type conversion
// Partial class
Partial class break the functionality of a single class into many files. When the application is
compiled, these files are then reassembled into a single class file.
Note↓
• Should have same namespace
• can have different class name
• can have many partial class no limitations
• can have main method in file contain partial class
Example:
File1.cs ↓
namespace PartialClassExample
{
public partial class Employee
{
private string firstName;
private string lastName;
class Program
{
static void Main()
{
Employee employee = new Employee("John", "Doe");
EmployeeDetails details = new EmployeeDetails();
details.DisplayDetails("HR");
}
}
File2.cs ↓
namespace PartialClassExample
{
public partial class EmployeeDetails
{
public void DisplayDetails(string department)
{
Console.WriteLine($"Name: {firstName} {lastName}, Department: {department}");
}
}
}
Extra↓
// Nullables
int a = null;
int? a = null;
❌
✔️
• These are the value types (int, float, double, bool) can't be null to make it null you need to use
(?).
• String is a class it comes under reference type can be null easily.(class, interface, arrays,
delegates, nullables)
// Static Method
• Can't create reference variable of Static Method
• A static method can be called in 2 ways
1) Method_name(); //in same class
2) Class_Name.Method_Name(); //in other class
https://www.c-sharpcorner.com/UploadFile/0c1bb2/types-of-inheritance-in-C-Sharp/
// 'sealed' keyword
When we use this keyword while creating class then the class cannot be inherited further.
Eg, " public sealed class A
{
} "