Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
18 views35 pages

Question Bank

The document is a study guide for ASP.NET focusing on the .NET Framework, Common Language Runtime (CLR), and Framework Class Library (FCL). It includes multiple-choice questions, explanations of key concepts, and programming fundamentals such as operators, conditional statements, and object-oriented programming in C#. Additionally, it covers ASP.NET controls and their functionalities in web forms.

Uploaded by

nallamanibca
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views35 pages

Question Bank

The document is a study guide for ASP.NET focusing on the .NET Framework, Common Language Runtime (CLR), and Framework Class Library (FCL). It includes multiple-choice questions, explanations of key concepts, and programming fundamentals such as operators, conditional statements, and object-oriented programming in C#. Additionally, it covers ASP.NET controls and their functionalities in web forms.

Uploaded by

nallamanibca
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 35

SRI RAM NALLMANI YADAVA COLLEGE OF ARTS AND SCIENCE

DEPARTMENT OF COMPUTER APPLICATIONS


ASP.NET
BCA-III
UNIT-I

By,
Dr.R.THIRUMALAISAMY
DEPARTMENT OF BCA
PART-A

1.What is the primary language for .NET development?

A) Java

B) Python

C) C#

D) Ruby

Answer (c)

2. What is the .NET Framework's garbage collection mechanism called?

A) ARC

B) GC

C) malloc

D) free

Answer( B)

3. What is the name of the .NET Framework's Just-In-Time compiler?

A) JIT

B) AOT

C) CLR

D) CSC

Answer(A)

4. What is the .NET Framework's type system called?

A) CTS

B) CLR

C) CLI
D) CTSM

Answer(A)

5. What is the name of the .NET Framework's runtime environment?

A) CLR

B) JVM

C) Runtime

D) Framework

Answer(A)

6. What is the .NET Framework's class library called?

A) FCL

B) BCL

C) CLR

D) API

Answer(B)

7. What is the .NET Framework's intermediate language called?

A) IL

B) MSIL

C) CIL

D) Both B and C

Answer( D)

8. What is the .NET Framework's assembly file extension?

A) .dll

B) .exe
C) Both A and B

D) .net

Answer(C)

9. What is the .NET Framework's security model called?

A) CAS

B) CLR

C) Security

D) Principal

Answer( A)

10. What is the .NET Framework's configuration file extension?

A) .config

B) .xml

C) .txt

D) .ini

Answer( A)
PART-B

1.Explain overview of.NET Framework?

The .NET Framework is a software framework developed by Microsoft that


provides a large library of pre-built functionality, known as the Framework Class
Library (FCL), and a virtual execution environment, known as the Common
Language Runtime (CLR).

Key Components:

1. Common Language Runtime (CLR): Manages memory, security, and other


system services.

2. Framework Class Library (FCL): Provides a vast collection of reusable classes,


interfaces, and types.

3. (link unavailable) For web development.

4. (link unavailable) For database access.

5. Windows Forms: For desktop application development.

Benefits:

1. Multi-language support: Supports multiple programming languages.

2. Memory management: Automatic memory management through garbage


collection.

3. Security: Provides robust security features.

4. Interoperability: Enables seamless interaction between different .NET


components.

.NET Framework Architecture:

1. Application layer: User-developed applications.

2. Framework layer: FCL and other framework components.

3. CLR layer: Manages memory, security, and other system services.


2.Explain Common Language Runtime?

The Common Language Runtime (CLR) is a key component of the .NET


Framework. It's a virtual execution environment that manages the execution
of .NET programs.

Key Features

1. Memory Management: CLR provides automatic memory management through


garbage collection, eliminating the need for manual memory allocation and
deallocation.

2. Security: CLR provides a robust security model, ensuring that code is executed
with the appropriate permissions and access control.

3. Type Safety: CLR ensures type safety, preventing type-related errors and
ensuring that code is executed correctly.

4. Interoperability: CLR enables seamless interaction between different .NET


languages and components.

How CLR Works:

1. Compilation: .NET code is compiled into an intermediate language called


Common Intermediate Language (CIL).

2. Loading: The CLR loads the CIL code into memory.

3. Verification: The CLR verifies the CIL code for type safety and other checks.

4. Execution: The CLR executes the CIL code, providing services like memory
management and security.

Benefits:

1. Simplified Development: CLR simplifies development by managing memory


and security.

2. Improved Productivity: CLR enables developers to focus on writing code rather


than managing low-level details.
CLR Services:

1. Garbage Collection: Automatic memory management.

2. Exception Handling: Robust error handling and debugging.

3. Security: Code access security and permissions management.

4. Reflection: Dynamic inspection and invocation of code.

3.Define Framework class Library?

The Framework Class Library (FCL) is a comprehensive collection of reusable


classes, interfaces, and types that provide a wide range of functionality for building
.NET applications.

Key Features:

1. Pre-built functionality: FCL provides pre-built functionality for common tasks.

2. Reusable code: FCL classes and types can be reused across multiple
applications.

3. Extensive coverage: FCL covers a broad range of areas, including:

- Data access ((link unavailable))

- User interface (Windows Forms, WPF)

- Web development ((link unavailable))

- Networking

- Security

- Diagnostics

Benefits:

1. Increased productivity: FCL reduces development time and effort.

2. Improved reliability: FCL classes and types are thoroughly tested and validated.
FCL Namespaces:

1. System: Core .NET functionality.

2. System.Data: Data access and manipulation.

3. System.Windows.Forms: Windows Forms UI development.

4. System.Web: Web development and (link unavailable)

5. System.Security: Security and cryptography.

4.Explain c# Fundamentals?

C# is a modern, object-oriented programming language developed by Microsoft as


part of its .NET initiative. Here are some key fundamentals:

Variables and Data Types:

1. Value types: int, float, bool, char, etc.

2. Reference types: string, array, class, interface, etc.

Operators:

1. Arithmetic operators: +, -, *, /, etc.

2. Comparison operators: ==, !=, <, >, etc.

3. Logical operators: &&, ||, !

Control Structures:

1. Conditional statements: if-else, switch

2. Loops: for, while, do-while, foreach

Functions:

1. Methods: reusable blocks of code

2. Parameters: passing data to methods


Object-Oriented Programming (OOP) Concepts:

1. Classes: defining custom data types

2. Objects: instances of classes

3. Inheritance: inheriting properties and behavior from base classes

4. Polymorphism: ability to take on multiple forms

Other Key Concepts:

1. Namespaces: organizing code into logical groups

2. Exception handling: handling runtime errors

3. Type safety: ensuring type consistency and preventing type-related errors

C# Syntax:

1. Case sensitivity: C# is case-sensitive

2. Type inference: C# can infer types in many cases

3. Lambda expressions: concise way to express functions

5.Explain Primitive types and variables?

C#, primitive types are the basic data types that are built into the language.
Variables are storage locations that hold values of these primitive types.

Primitive Types:

1. Integer types: byte, sbyte, short, ushort, int, uint, long, ulong

2. Floating-point types: float, double, decimal

3. Boolean type: bool

4. Character type: char

5. String type: string (technically a reference type, but often treated as a primitive
type)
Variables:

1. Declaration: specifying the type and name of a variable

2. Assignment: assigning a value to a variable

3. Initialization: declaring and assigning a value to a variable in a single step

Key Characteristics:

1. Value types: primitive types are value types, meaning they store their values
directly

2. Type safety: C# ensures type safety, preventing assignment of incorrect types to


variables

3. Memory allocation: primitive types are typically allocated on the stack

Examples:

1. Integer variable: int x = 5;

2. Boolean variable: bool isAdmin = true;

3. String variable: string name = "John";

PART-C

1.Explain Operators?

In ASP.NET, operators are used in C# or VB.NET code to perform various


operations. The operators used in ASP.NET are the same as those used in C# or
VB.NET.

Types of Operators:

1. Arithmetic Operators: used for mathematical operations

2. Comparison Operators: used for comparing values


3. Logical Operators: used for logical operations

4. Assignment Operators: used for assigning values

5. String Operators: used for string manipulation

Examples in ASP.NET:

1. Conditional statements: if (x > 5) { ... }

2. Loops: for (int i = 0; i < 10; i++) { ... }

3. Data binding: <%# Eval("PropertyName") %>

ASP.NET-specific operators:

1. Eval: used for data binding

2. Bind: used for two-way data binding

Best Practices:

1. Use operators correctly: ensure correct syntax and usage

2. Use parentheses: clarify operator precedence and improve code readability

3. Test code thorughly: verify that operators are working as expected

In ASP.NET, operators are used in code-behind files, markup files, or Razor views
to perform various operations and manipulate data. Understanding operators is
essential for building robust and efficient ASP.NET applications.

Common Operators Used in ASP.NET

1. Conditional operators: if, else, switch

2. Logical operators: &&, ||, !

3. Comparison operators: ==, !=, >, <, >= , <=

4. Arithmetic operators: +, -, *, /, %

5. Assignment operators: =, += , -=, *=, /=, %=


Example in ASP.NET (C#):

int x = 5;

if (x > 10)

Label1.Text = "x is greater than 10";

else

Label1.Text = "x is less than or equal to 10";

In this example, comparison and conditional operators are used to determine the
value of x and display a message accordingly.

Key Takeaways:

1. Use operators for conditional logic: if, else, switch

2. Use operators for data manipulation: arithmetic, comparison, logical

3. Use operators for assignment: assign values to variables

2.Explain conditional Statements”?

Conditional statements are used to control the flow of a program based on


conditions or decisions. They allow you to execute specific blocks of code if
certain conditions are met.
Types of Conditional Statements:

1. If Statement: used to execute a block of code if a condition is true

2. If-Else Statement: used to execute one block of code if a condition is true and
another block if it's false

3. Switch Statement: used to execute different blocks of code based on the value of
a variable

Examples:

1. If Statement: if (x > 5) { Console.WriteLine("x is greater than 5"); }

2. If-Else Statement: if (x > 5) { Console.WriteLine("x is greater than 5"); } else


{ Console.WriteLine("x is less than or equal to 5"); }

3. Switch Statement: switch (color) { case "Red": Console.WriteLine("The color is


red"); break; case "Blue": Console.WriteLine("The color is blue"); break; default:
Console.WriteLine("Unknown color"); break; }

Best Practices:

1. Use meaningful variable names: improve code readability

2. Use comments: explain complex logic

3. Test conditions thoroughly: ensure conditions are working as expected

Benefits:

1. Control flow: conditional statements control the flow of a program

2. Decision-making: conditional statements enable decision-making in code

3. Flexibility: conditional statements provide flexibility in coding


3.Explain looping statements?

Most programming languages have three main types of loops:

1. For Loop

 Used when the number of iterations is known.


 Syntax (e.g., in C/C++/Java):

for (int i = 0; i < n; i++) {


// code to repeat
}

 Use Case in DS: Traversing arrays or matrices.

2. While Loop

 Used when the number of iterations is unknown; runs as long as a condition


is true.

while (condition) {
// code to repeat
}

 Use Case in DS: Traversing a linked list until reaching NULL.

3. Do-While Loop

 Similar to while, but executes the code block at least once, then checks the
condition.

do {
// code to repeat
} while (condition);

 Use Case in DS: Useful when you must execute an operation at least once
before checking a condition.
Common Applications in Data Structures

Data Structure Typical Loop Use


Array for loop for traversal
Linked List while loop to go node by node
Stack while loop until stack is empty
Queue while loop for dequeue operations
Tree while loop with a stack or recursion (in-order, pre-order)
Graph while loop in BFS/DFS using queue or stack

Example: Traversing an Array

int arr[] = {1, 2, 3, 4, 5};


int n = sizeof(arr) / sizeof(arr[0]);

for (int i = 0; i < n; i++) {


cout << arr[i] << " ";
}

4.Define creating and using objects?

1. Creating Objects

Creating an object means instantiating a class using the new keyword (in most
OOP languages).

Syntax (Example in Java):

java
CopyEdit
ClassName objectName = new ClassName();
Example:

class Car {
void startEngine() {
System.out.println("Engine started");
}
}

// Creating an object of class Car


Car myCar = new Car();

2. Using Objects

Using an object means accessing its methods and variables.

Example (continued):

myCar.startEngine(); // Calling method using object

5.Explain Array & String operations?

1. Array Operations

Definition:

An array is a collection of elements (of the same data type) stored in contiguous
memory locations.

Common Array Operations:

Operation Description Example (in Java)

Declaration Defining an array int[] arr = new int[5];

Initialization Assigning values int[] arr = {1, 2, 3, 4, 5};

Access Getting a value by index arr[0] returns 1

Update Changing a value arr[2] = 10;

Looping through array for(int i : arr)


Traversal
elements { System.out.println(i); }

Search Finding an element Linear or binary search

Sort Arranging in order (asc/desc) Using Arrays.sort(arr) in Java


Operation Description Example (in Java)

Finding the number of


Length arr.length
elements

2. String Operations

Definition:

A string is a sequence of characters. Strings are widely used to represent text.

Common String Operations:

Operation Description Example (in Java)

Declaration Creating a string String s = "Hello";

s + " World" gives "Hello


Concatenation Joining two strings
World"

Length Number of characters s.length() returns 5

Access (char) Get a character at a position s.charAt(0) returns 'H'

Substring Extract a part of the string s.substring(1, 4) returns "ell"

Compare Compare two strings s.equals("Hello")

Find position of a character or


Search s.indexOf('e') returns 1
substring

Replace Replace part of the string s.replace("l", "x") → "Hexxo"

To s.toUpperCase() returns
Change case
Upper/Lower "HELLO"

SRI RAM NALLMANI YADAVA COLLEGE OF ARTS AND SCIENCE


DEPARTMENT OF COMPUTER APPLICATIONS
ASP.NET
BCA-III
UNIT-II

By,
Dr.R.THIRUMALAISAMY
DEPARTMENT OF BCA

PART-A

1. Which control is used to group other controls in ASP.NET Web Forms?


A. Label
B. Panel
C. Button
D. TextBox
Answer (B)
2. Which control is used to submit a Web Form?
A. TextBox
B. Label
C. Button
D. DropDownList
Answer (C)
3. Which file contains the design part of a Web Form?
A. .cs
B. .aspx.cs
C. .aspx
D. .config

Answer(C)

4. What is the default event of a Button control?


A. Click
B. Load
C. Change
D. Submit
Answer (A)
5. Which ASP.NET control is used to display data in tabular format?
A. Label
B. GridView
C. TextBox
D. Panel
Answer (B)
6. Which object represents the current web request?
A. Request
B. Response
C. Server
D. Session
Answer (A)

7. Which control allows users to select one item from a drop-down list?
A. CheckBoxList
B. RadioButtonList
C. DropDownList
D. ListBox
Answer (C)
8. What is used to store user data across multiple pages?
A. Request
B. Response
C. Session
D. ViewState
Answer(C)
9. Which method is used to redirect to another page in ASP.NET?
A. Transfer()
B. Redirect()
C. Navigate()
D. GoTo()
Answer(B)
10. What is the extension of the code-behind file in Web Forms?
A. .aspx
B. .aspx.vb / .aspx.cs
C. .dll
D. .xml
Answer( B)

PART-B
1.Explain ASP.NET?
ASP.NET stands for Active Server Pages .NET.
It is a server-side web application framework developed by Microsoft that allows
developers to build dynamic web applications, websites, and web services.

Key Features of ASP.NET:

Feature Description

Server-side Code runs on the server before it is sent to the browser

Compiled Language Uses languages like C# or VB.NET for fast execution

Rich Toolbox Provides powerful controls (like GridView, DropDownList,


Feature Description

etc.)

State Management Maintains user data with Session, ViewState, and Cookies

Security Built-in authentication and authorization mechanisms

Separation of Code Supports code-behind model using .aspx and .aspx.cs/.vb files

Scalability Suitable for small to large enterprise-level applications

ASP.NET Architecture:

Client (Browser) – Sends request

Web Server (IIS) – Hosts ASP.NET application

ASP.NET Engine – Processes request and returns HTML

Database (Optional) – Stores/retrieves data if required

2.Explain IDE?

IDE stands for Integrated Development Environment.


It is a software application that provides a comprehensive environment for writing,
testing, and debugging code.\

Main Features of an IDE:

Feature Description

Code Editor Main window where you write your code

Compiler/Interpreter Converts code into executable form

Debugger Helps find and fix errors in code

Build Automation Automates tasks like compiling and running programs


Feature Description

Syntax Highlighting Uses colors to differentiate keywords, variables, etc.

Code Suggestions Offers auto-completion and error correction

Project Management Organizes files and folders for easier project handling

3. Explain Languages supported Components?

ASP.NET has several components that make it powerful for web development:

1. Web Forms

UI-based development model (drag-and-drop).

Uses .aspx pages.

Events and controls like Button, TextBox.

2. MVC (Model-View-Controller)

Separates logic, UI, and data.

Great for testable, scalable apps.

3. Web API

Used to create RESTful services.

Communicates with mobile, desktop, or other web apps.

4. Razor Pages

Simplified page-based model.

Cleaner syntax using Razor (@ directives).

5. Core Services

Session State, Application State, Caching.


Security (Authentication/Authorization).

Configuration via web.config.

6. ADO.NET / Entity Framework

For database access and manipulation.

ADO.NET = low-level; EF = object-relational mapping (ORM).

7. User Controls and Custom Controls

Reusable UI blocks in .ascx files or compiled DLLs.

8. State Management Tools

ViewState, Session, Cookies, Query Strings.

4.What is Web Forms?

Web Forms is a UI-based development model in ASP.NET used to create dynamic,


interactive web applications. It allows developers to design web pages using
controls (like buttons, textboxes) and handle their logic in the code-behind file.

Key Components of Web Forms:

Component Description
.aspx File The HTML/UI design page
Code-Behind
Contains the C# or VB.NET code that handles events
(.aspx.cs/.vb)
Controls like TextBox, Button, GridView that run on the
Server Controls
server
Handles user actions like button clicks using server-side
Event Handling
code

Example: Simple Web Form

<!-- Web Form Design (Default.aspx) -->


<asp:TextBox ID="TextBox1" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Greet"
OnClick="Button1_Click" />
<asp:Label ID="Label1" runat="server" />
csharp
CopyEdit
// Code-Behind (Default.aspx.cs)
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "Hello, " + TextBox1.Text;
}

Features of Web Forms:

 Event-driven programming (like Windows apps)


 Drag-and-drop design using Visual Studio
 State management using ViewState
 Built-in validation controls
 Rich control library (e.g., Calendar, GridView)

Advantages:

 Rapid development using GUI


 Easy for beginners (like desktop app development)
 Rich toolbox and designer in Visual Studio

Disadvantages:

 Less control over HTML output


 Not ideal for large-scale or SEO-focused apps
 ViewState can cause performance overhead

5.Explain HTML?

What is HTML?
HTML stands for HyperText Markup Language.
It is the standard language used to create and structure webpages.

HTML is not a programming language — it is a markup language used to define


the structure and layout of content on the web.

Basic Structure of an HTML Document:

html
CopyEdit
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is a paragraph.</p>
</body>
</html>

Common HTML Elements:

Tag Description Example


Root of an HTML
<html> <html> ... </html>
document
<head> Metadata, title, links to CSS <head> ... </head>
<body> Main content of the page <body> ... </body>
<h1>– Headings (largest to
<h1>Heading</h1>
<h6> smallest)
<p> Paragraph <p>This is a paragraph.</p>
<a
<a> Hyperlink
href="https://example.com">Click</a>
<img> Image <img src="image.jpg" alt="My Image">
<ul>/<ol> Unordered/Ordered list <ul><li>Item</li></ul>
<table> Table structure <table><tr><td>Data</td></tr></table>
Generic container for
<div> <div>Content</div>
grouping
Key Features of HTML:

 Defines structure of web pages


 Works with CSS (for design) and JavaScript (for behavior)
 Platform-independent
 Browser-friendly and easy to learn

Advantages of HTML:

 Simple to use and learn


 Supported by all browsers
 Works with all types of media (images, videos, etc.)
 Lightweight and fast-loading

Limitations of HTML:

 Cannot perform logic or dynamic actions by itself


 Needs CSS for styling and JavaScript for interactivity
 Static in nature (unless combined with backend or scripts)

PART-C

1.Explain working with web forms?

1. Working with Web Forms in ASP.NET

Web Forms in ASP.NET are used to create interactive, dynamic web pages using a
visual drag-and-drop interface and a code-behind file for logic.

They provide a desktop-application-like model for web development.

Working of Web Forms (Step-by-Step):

1. Design the UI using .aspx file

Use ASP.NET controls like TextBox, Button, Label, etc.


HTML and Web Server controls are mixed together.

<!-- Default.aspx -->

<asp:TextBox ID="txtName" runat="server" />

<asp:Button ID="btnSubmit" Text="Submit" runat="server"


OnClick="btnSubmit_Click" />

<asp:Label ID="lblResult" runat="server" />

2. Write logic in the code-behind file (.aspx.cs or .aspx.vb)

// Default.aspx.cs

protected void btnSubmit_Click(object sender, EventArgs e)

lblResult.Text = "Hello, " + txtName.Text;

The code-behind file handles user input and events like button clicks.

3. Page Life Cycle Events

Stage Description

Page_Load Executes when the page is loaded

PostBack Occurs when a user interacts and the page reloads

Event Handling Triggers when a control event (e.g., click) fires

Render Converts the page into HTML to send to browser

Important Concepts:
Concept Description

ViewState Maintains control values between postbacks

PostBack Reloading the same page on user actions

Server Controls Controls that are processed on the server (e.g., <asp:Button>)

Validation Controls Used to validate input data (e.g., RequiredFieldValidator)

Advantages of Using Web Forms:

Easy drag-and-drop development in Visual Studio

Automatic state management using ViewState

Rich set of controls (TextBox, DropDownList, GridView, etc.)

Rapid application development

Limitations:

Heavy ViewState can reduce performance

Less control over HTML and JavaScript

Not suitable for SEO-sensitive applications

2.Explain HTML Controls?

HTML controls are the basic building blocks used in HTML to create interactive
elements on a web page — such as text boxes, buttons, checkboxes, and forms.

These controls are standard HTML elements that are interpreted directly by the
browser.
Types of HTML Controls:

Control Type Tag / Attribute Description

Allows user to enter a single


Text Input <input type="text">
line of text

Password Hides the text input (for


<input type="password">
Field passwords)

Button <input type="button"> or <button> Clickable button

Submit Submits the form data to the


<input type="submit">
Button server

Reset Button <input type="reset"> Resets the form fields

Allows selection of multiple


Checkbox <input type="checkbox">
options

Allows selection of a single


Radio Button <input type="radio">
option from a group

Text Area <textarea> Multiline text input

Dropdown
<select><option></option></select> Provides a dropdown list
List

Allows file selection from user


File Upload <input type="file">
system

Displays descriptive text for


Label <label>
inputs

Stores data that is not visible to


Hidden Field <input type="hidden">
user

Example of Common HTML Controls:

<form>
Name: <input type="text" name="username"><br>

Password: <input type="password" name="password"><br>

Gender:

<input type="radio" name="gender" value="male"> Male

<input type="radio" name="gender" value="female"> Female<br>

<input type="checkbox" name="subscribe"> Subscribe to newsletter<br>

<input type="submit" value="Submit">

</form>

Purpose of HTML Controls:

Gather user input

Create forms for data submission

Build interactive UI elements

Used in login pages, surveys, registration forms, etc.

3.Explain List controls and its properties?

List controls in ASP.NET are used to display and manage lists of data items. They
allow users to select one or more items from a collection. These controls are
commonly used in forms, surveys, dropdowns, and data selection interfaces.

Common List Controls in ASP.NET:

Control Name Description

DropDownList Displays a single-item dropdown list

ListBox Displays a scrollable list of items (multi-select possible)

CheckBoxList Displays multiple checkboxes in a list format


Control Name Description

RadioButtonList Displays a group of radio buttons

BulletedList Displays a bulleted list of text items (non-selectable)

Common Properties of List Controls:

Property Description

ID Unique identifier for the control

Items Collection of list items in the control

SelectedIndex Index of the selected item

SelectedItem The currently selected item

SelectedValue The value of the selected item

DataSource Binds the control to a data source like a database or array

DataTextField Field to display in the list

DataValueField Value associated with each list item

AutoPostBack Triggers postback when selection changes (True/False)

SelectionMode (ListBox only) — allows Single or Multiple selection

(For CheckBoxList/RadioButtonList) — Horizontal or Vertical


RepeatDirection
layout

RepeatColumns Sets number of columns (for better layout)

4.Explain web form properties and its events?


A Web Form in ASP.NET is a .aspx page that acts as a container for web server
controls and provides a way to design interactive webpages using both HTML and
ASP.NET controls.

Web Form Properties:

These are attributes you can set for the entire Web Form or individual controls:

Property Description

ID Unique identifier for the form

EnableViewState Enables or disables ViewState (default: true)

Returns true if the page is being loaded in response to a


IsPostBack
postback

ClientID Gets the browser-generated ID for the control

Visible Determines whether the form/control is visible

Page Refers to the Page object to which the control belongs

AppRelativeVirtualPath Path of the page in the application

Prevents potentially dangerous input (e.g., script


ValidateRequest
injection)

Example:

<asp:TextBox ID="txtName" runat="server"


EnableViewState="true"></asp:TextBox>

Web Form Events:

Events are actions triggered by user interactions or the system.


Event Description

Page_Load Triggered each time the page is loaded

Raised during page initialization (before view state is


Page_Init
restored)

Page_PreRender Occurs just before the output is rendered to the user

Occurs after page has been fully rendered and sent to the
Page_Unload
client

Page_Error Raised when an unhandled exception occurs on the page

Click Occurs when a Button is clicked

SelectedIndexChanged Triggered when a selection is changed in a list control

Occurs when the text of a TextBox changes and


TextChanged
AutoPostBack is true

5.Explain HTML and List?

What is HTML?

HTML stands for HyperText Markup Language.


It is the standard language used to create and design webpages. HTML provides
the structure for web content.

Key Features of HTML:

Markup language (not a programming language)

Uses tags to define elements (e.g., headings, paragraphs, images, links)

Works with CSS (for styling) and JavaScript (for interactivity)

Interpreted by all web browsers


Basic HTML Example:

<!DOCTYPE html>

<html>

<head>

<title>My Web Page</title>

</head>

<body>

<h1>Welcome</h1>

<p>This is a simple HTML page.</p>

</body>

</html>

What is a List in HTML?

Lists are used in HTML to display items in a structured format. HTML supports
three types of lists:

1. Ordered List (<ol>)

Displays items in a numbered sequence.

<ol>

<li>First Item</li>

<li>Second Item</li>

<li>Third Item</li>

</ol>
2. Unordered List (<ul>)

Displays items with bullets.

<ul>

<li>Apple</li>

<li>Banana</li>

<li>Cherry</li>

</ul>

3. Definition List (<dl>)

Displays terms and descriptions.

<dl>

<dt>HTML</dt>

<dd>HyperText Markup Language</dd>

<dt>CSS</dt>

<dd>Cascading Style Sheets</dd>

</dl>

You might also like