AVD Assignment No 1&2
AVD Assignment No 1&2
Definition: The Base Class Library (BCL) is a core set of classes that
are included in every .NET implementation. It provides fundamental
types like System.Object, System. String, System. DateTime,
collections like List<T>, Dictionary<TKey, TValue>, and basic file I/O
operations.
Purpose: The BCL is the foundation for all .NET applications and is
essential for everyday tasks, such as handling strings, dates,
numbers, arrays, collections, and file access.
Components:
Definition: .NET Core libraries are specific to the .NET Core runtime
and include cross-platform libraries that support cloud, IoT, and
console applications. .NET 5 and later versions unify .NET Core, .NET
Framework, and Mono/Xamarin.
5. Third-Party Libraries
1. Arithmetic Operators
o Example: if (a == b)
o Example: if (a != b)
3. Logical Operators
o Example: if (a && b)
o Example: if (a || b)
o Example: if (!a)
4. Bitwise Operators
o Example: result = a | b;
5. Assignment Operators
o Example: a = b;
Add and assign (+=): Adds the right operand to the left operand
and assigns the result to the left operand.
o Example: a += b;
if Statement
Syntax:
csharp
if (condition)
Example:
csharp
if (number > 0)
2. Looping Statements
for Loop
Syntax:
csharp
Example:
csharp
3. Jump Statements
break Statement
Syntax:
csharp
break;
Example:
csharp
if (i == 5)
4. Method Overriding
5. base Keyword
Types of Inheritance
1. Single Inheritance
o Example:
csharp
class Animal
Console.WriteLine("Animal is eating");
Console.WriteLine("Dog is barking");
In this example, Dog is the derived class, and Animal is the base class.
The Dog class inherits the Eat method from the Animal class.
2. Multilevel Inheritance
o Example:
csharp
class Animal
Console.WriteLine("Animal is eating");
}
class Mammal : Animal
Console.WriteLine("Dog is barking");
3. Hierarchical Inheritance
o Example:
csharp
class Animal
Console.WriteLine("Animal is eating");
}
class Dog : Animal
Console.WriteLine("Dog is barking");
Console.WriteLine("Cat is meowing");
1. Type
2. Value Types
Value types are types that hold their data directly in the memory location
where the variable is stored. When you assign a value type to another
variable, a copy of the data is made.
Characteristics of Value Types:
Example:
csharp
int a = 5;
Console.WriteLine(a); // Output: 5
Console.WriteLine(b); // Output: 10
3. Reference Types
Example:
csharp
class Person
person1.Name = "Alice";
Assignment No 2
1) What is difference between .aspx and .cs files
Explain whit a example
.aspx .cs
1. Button
The Button control represents a clickable button that can trigger server-
side events when clicked. It is commonly used for form submissions or
interactive operations.
Key Properties:
Example:
html
<asp:Button ID="Button1" runat="server" Text="Submit"
OnClick="Button1_Click" />
csharp
Copy code
Response.Write("Button clicked!");
2. TextBox
The TextBox control is used for input fields where users can enter text. It is
often used for capturing user input.
Key Properties:
Example:
html
csharp
Copy code
3. Label
Key Properties:
html
csharp
4. DropDownList
Key Properties:
Example:
html
</asp:DropDownList>
csharp
Copy code
5. GridView
The GridView control is used to display data in a tabular format. It
provides features like sorting, paging, and editing.
Key Properties:
Example:
html
</asp:GridView>
csharp
dt.Columns.Add("Name");
dt.Columns.Add("Age");
dt.Rows.Add("Alice", "30");
dt.Rows.Add("Bob", "25");
GridView1.DataSource = dt;
GridView1.DataBind();
1. Text
o Example:
html
csharp
2. TextMode
o Possible Values:
o Example:
html
3. MaxLength
o Example:
html
4. ReadOnly
o Possible Values:
o Example:
html
1. AutoPostBack
Purpose:
How It Works:
Common Controls:
DropDownList
CheckBox
RadioButton
TextBox
Example:
ASPX Page:
html
</asp:DropDownList>
Code-Behind (Example.aspx.cs):
csharp
}
In this example, changing the selected item in the DropDownList
automatically posts back to the server, triggering the
DropDownList1_SelectedIndexChanged event handler.
2. runat
Purpose:
How It Works:
Example:
ASPX Page:
html
</form>
Code-Behind (Example.aspx.cs):
csharp
}
5) Explain menu and preview navigation site control
1. Menu Control
Features:
Common Properties:
Example:
html
<Items>
<asp:MenuItem Text="Products">
<asp:MenuItem Text="Electronics"
NavigateUrl="~/Electronics.aspx" />
</asp:MenuItem>
</Items>
</asp:Menu>
2. SiteMapPath Control
Features:
Example:
html
Common Properties
1. Series
o Example:
csharp
series.Points.AddXY("January", 100);
series.Points.AddXY("February", 150);
Chart1.Series.Add(series);
2. ChartAreas
o Description: Defines the area where the chart data is plotted.
You can customize the chart area’s size, position, and other
properties.
o Example:
csharp
Chart1.ChartAreas.Add(chartArea);
3. Legends
o Example:
csharp
Chart1.Legends.Add(legend);
4. Titles
o Example:
csharp
Chart1.Titles.Add(title);
1. Error Identification:
2. Breakpoints:
3. Step Execution:
o Steps:
4. Watch Variables:
5. Call Stack: