ASP.NET Question Bank 2026 – Prepare, Practice & Excel with Bloom’s Taxonomy

Are you preparing for an ASP.NET university exam? This complete ASP.NET Question Bank includes a systematic collection of MCQs, 1-mark, 2-mark, 3-mark, 4-mark and 5-mark questions categorized by syllabus topics and Bloom’s Taxonomy.

The question bank is intended to help students revise ASP.NET concepts, practice different levels of questions and prepare for university examinations.

The questions cover important topics like ASP.NET Framework, server controls, C# programming, validation controls, state management, Master Pages, Themes and site navigation.

According to Microsoft’s ASP.NET documentation, server controls provide a structured programming model, including server-side events and state management.

What You’ll Find in This ASP.NET Question Bank

this question bank includes:

  • ASP.NET MCQs
  • 1-mark questions
  • 2-mark questions
  • 3-mark questions
  • 4-mark questions
  • 5-mark questions
  • Application-based questions
  • Scenario-based questions
  • Higher-order thinking questions
  • Bloom’s Taxonomy-based questions
  • Unit-wise question banks
  • ASP.NET practical-oriented questions
  • Important revision questions

The higher-mark questions focus increasingly on application, analysis, evaluation and creation, rather than only asking students to recall definitions.

ASP.NET Question Bank – Unit-wise

Let us begin this ASP.Net question bank from Unit 1 – Introduction to .NET. This unit consists of questions from these topics:

  • ASP.NET Framework
  • Origin of .NET Technology
  • Common Language Runtime (CLR)
  • Managed and Unmanaged Code
  • Common Type System (CTS)
  • Common Language Specification (CLS)
  • Microsoft Intermediate Language (MSIL)
  • Just-in-Time (JIT) Compiler
  • Framework Base Classes
  • Assemblies – Private Assemblies, Shared Assemblies
  • Garbage Collection

Here we go!

Below is a structured question bank.

Unit 1 – Introduction to .NET

Bloom’s Taxonomy Keywords to Use:

LevelUseful Keywords
RememberDefine, List, Name, Identify, State, Recall, Mention
UnderstandExplain, Describe, Summarize, Discuss, Differentiate
ApplyApply, Demonstrate, Implement, Use, Solve, Illustrate
AnalyzeAnalyze, Compare, Contrast, Examine, Differentiate, Classify
EvaluateEvaluate, Justify, Critique, Assess, Defend, Recommend
CreateDesign, Develop, Construct, Propose, Formulate, Create

Multiple Choice Questions – 30

Blooms taxonomy keyword: Remember / Understand

1. What does CLR stand for?
A. Common Language Runtime
B. Common Language Resource
C. Common Level Runtime
D. Common Language Repository

2. Which component is responsible for executing managed code in .NET?
A. CTS
B. CLR
C. CLS
D. MSIL

3. What does CTS stand for?

4. What does CLS stand for?

5. MSIL stands for _____________

6. Which component converts MSIL into native machine code?
A. CLR
B. CTS
C. JIT Compiler
D. CLS

7. Which of the following is a characteristic of managed code?

8. Which component provides automatic memory management?

9. What is an assembly in .NET?

10. Which assembly is intended for use by multiple applications?

11. Which assembly is generally associated with a single application?

12. What is Garbage Collection?

13. Which component provides a common type system for .NET languages?

14. Which component defines language interoperability rules?

15. What is the primary purpose of the .NET Framework?

16. Which language-independent intermediate code is generated by .NET compilers?

17. What happens to MSIL before execution?

18. Which of the following is associated with memory management?

19. What is unmanaged code?

20. Which feature allows different .NET languages to work together?

Understanding/Application-oriented MCQs

21. A C# program is compiled into MSIL. What happens next?

22. If an application needs automatic memory management, which .NET feature provides it?

23. If a developer wants an assembly to be shared by several applications, which type should be considered?

24. Which component enables different programming languages to use common data types?

25. Which component ensures that languages follow a common set of specifications for interoperability?

26. A developer wants code to execute on different platforms supported by the .NET implementation. Which concept is most relevant?

27. Which sequence correctly represents .NET program execution?

28. Which component is most directly involved in converting intermediate code into native code at execution time?

29. Why is Garbage Collection useful in .NET?

30. Which statement best distinguishes managed code from unmanaged code?

Answers:

Here are the answers to all 30 questions:

Answers

  1. A. Common Language Runtime
  2. B. CLR
  3. CTS – Common Type System
  4. CLS – Common Language Specification
  5. MSIL – Microsoft Intermediate Language
    (Also commonly referred to as Intermediate Language/IL.)
  6. C. JIT Compiler
  7. Managed code is executed and managed by the CLR.
  8. CLR (through Garbage Collection)
  9. An assembly is a compiled unit of deployment in .NET containing MSIL, metadata, and other resources.
  10. Shared Assembly (Strong-Named Assembly)
  11. Private Assembly
  12. Garbage Collection is the automatic process of identifying and releasing memory occupied by objects that are no longer in use.
  13. CTS – Common Type System
  14. CLS – Common Language Specification
  15. The primary purpose of the .NET Framework is to provide a common environment and libraries for developing and executing applications.
  16. MSIL (Microsoft Intermediate Language)
  17. MSIL is converted into native machine code by the JIT compiler before/during execution.
  18. CLR / Garbage Collector
  19. Unmanaged code is code that executes outside the control of the CLR and manages resources/memory directly, such as traditional C/C++ native code.
  20. CLS and CTS
    (CTS provides common types, while CLS promotes language interoperability.)

Understanding/Application-Oriented MCQs

  1. MSIL is loaded by the CLR and converted into native machine code by the JIT compiler before execution.
  2. Garbage Collection (GC)
  3. Shared Assembly / Strong-Named Assembly
  4. CTS (Common Type System)
  5. CLS (Common Language Specification)
  6. Platform independence / portability of .NET applications
  7. Source Code → .NET Compiler → MSIL → CLR/JIT Compiler → Native Machine Code → Execution
  8. JIT Compiler
  9. Garbage Collection automatically releases memory occupied by unused objects, reducing the need for manual memory management.
  10. Managed code runs under the control of the CLR, which provides services such as garbage collection and type safety; unmanaged code runs outside CLR control and generally requires manual resource/memory management.

1-Mark Questions – 20

Remember – Keywords: Define, State, List, Identify, Name

1) Define the .NET Framework.

2) State the main objective of the .NET Framework.

3) Define CLR.

4) State the role of CLR.

5) Define managed code.

6) Define unmanaged code.

7) Expand CTS.

8) Expand CLS.

9) Expand MSIL.

10) What is JIT Compiler?

11) What is an assembly?

12) Name the two types of assemblies discussed in the syllabus.

13) Define Garbage Collection.

14) Name the component responsible for executing managed code.

15) State the purpose of MSIL.

3-Mark Questions – 15

Understand – Keywords: Explain, Describe, Differentiate, Summarize

1) Explain the concept of the .NET Framework.

2) Describe the origin and evolution of .NET technology.

3) Explain the role of CLR in .NET.

4) Differentiate between managed and unmanaged code.

5) Explain CTS with a suitable example.

6) Explain CLS and its importance.

7) Describe MSIL and explain why it is generated.

8) Explain the role of the JIT Compiler.

9) Differentiate CTS and CLS.

Complete Answer:
CTS and CLS are both important parts of the .NET Framework, but they have different purposes. CTS defines the complete type system of .NET, including data types and rules for their use. CLS defines a subset of common rules that .NET languages should follow so that components written in different languages can interoperate.

Expected Points:

CTSCLS
Common Type SystemCommon Language Specification
Defines .NET data typesDefines common language rules
Defines rules for typesDefines rules for language interoperability
Provides type safetyProvides cross-language compatibility
Broader conceptSubset of common language features
Concerned mainly with typesConcerned mainly with language interoperability

Key Point:
CTS defines what types are available, while CLS defines which common language features can be safely shared between .NET languages.

10) Explain the concept of an assembly.

11) Differentiate private and shared assemblies.

Complete Answer:
A private assembly is normally intended for use by a specific application and is generally stored in the application’s directory. A shared assembly is designed to be used by multiple applications and, in the traditional .NET Framework model, can be installed in the Global Assembly Cache (GAC). Shared assemblies typically have strong names for identification and versioning.

Expected Points:

Private AssemblyShared Assembly
Used by a particular applicationCan be used by multiple applications
Usually stored in application directoryTraditionally installed in GAC
Does not normally need to be shared system-wideDesigned for shared use
Simple deploymentSupports centralized/shared deployment
Usually application-specificUsually reusable across applications

12) Explain the purpose of Garbage Collection.

13) Describe how CLR supports multiple .NET programming languages.

14) Explain how MSIL and JIT work together.

15) Summarize the major features of the .NET Framework.

3-Mark Questions – 15

Apply / Analyze – Keywords: Demonstrate, Illustrate, Compare, Analyze, Classify

1) Illustrate the execution process of a C# program from source code to machine code.

2) Demonstrate the role of CLR in executing a .NET application.

3) Compare managed and unmanaged code with suitable examples.

Prepare yourself from previous section.

4) Analyze the relationship between CTS and CLS.

5) Illustrate the role of MSIL in language interoperability.

Prepare your answer from previous section.

6) Explain and demonstrate how JIT compilation takes place.

7) Compare private and shared assemblies.

Prepare answer from previous section.

8) Analyze why Garbage Collection is required in managed environments.

9) Classify the major responsibilities of CLR.

10) Compare the roles of CLR, CTS and CLS.

Complete Answer:

CLR, CTS, and CLS are three important components of the .NET platform, but each has a different role.

The CLR provides the runtime environment for executing managed code. The CTS defines the common data types and rules used by .NET languages. The CLS defines a common subset of language features and rules that supports interoperability between .NET languages.

Together, they help .NET applications execute consistently and allow components written in different languages to work together.

Expected Points:

CLRCTSCLS
Common Language RuntimeCommon Type SystemCommon Language Specification
Executes and manages managed code.Defines common data types and type rules.Defines common language interoperability rules.
Provides runtime services.Supports type safety and consistency.Supports cross-language compatibility.
Works with the JIT compiler.Provides a common type foundation.Defines a subset of language features.
Example: Memory management.Example: System.Int32.Example: CLS-compatible public interfaces.

Key Point:

  • CLR: Executes the code.
  • CTS: Defines the types.
  • CLS: Defines common rules for language interoperability.

11) Illustrate the complete .NET compilation and execution process.

12) Analyze how .NET supports multiple programming languages.

13) Demonstrate why MSIL is considered intermediate code.

14) Compare automatic memory management with manual memory management.

Complete Answer:

Automatic memory management is a mechanism in which the runtime manages memory allocation and reclaims memory from objects that are no longer reachable. In .NET, the CLR provides garbage collection for managed memory.

Manual memory management requires the programmer to explicitly allocate and release memory or use language-specific resource-management mechanisms. Native C and C++ programs commonly provide explicit memory-management facilities.

Automatic memory management reduces the risk of forgetting to release memory, while manual memory management can provide more direct control but requires careful handling.

Expected Points:

Automatic Memory ManagementManual Memory Management
Runtime manages managed memory.Programmer explicitly manages memory.
Garbage collection reclaims eligible objects.Memory is released using appropriate language mechanisms.
Reduces manual memory-management work.Requires careful memory management.
Reduces the risk of certain memory errors.Errors can occur if memory is not released correctly.
Example: Objects in a C# .NET application.Example: Dynamically allocated memory in native C using malloc() and free().

Important Note: Automatic garbage collection does not remove the need to close files, database connections, or other external resources appropriately.

15) Analyze the importance of assemblies in deploying .NET applications.

5-Mark Questions

Evaluate / Create – Keywords: Evaluate, Justify, Design, Develop, Propose

1) Explain and analyze the architecture of the .NET Framework with a neat diagram.

Ans.: The .NET Framework is a software development platform developed by Microsoft for building and executing Windows applications, web applications, and other software. Its architecture consists of several components that work together to provide a common execution environment, reusable libraries, language interoperability, and automatic memory management.

The major components of the .NET Framework architecture are the Common Language Runtime (CLR), Framework Class Library (FCL), Common Type System (CTS), Common Language Specification (CLS), Microsoft Intermediate Language (MSIL), and Just-In-Time (JIT) compiler.

.netframework

Explanation

1. Common Language Runtime (CLR): The CLR provides the execution environment for managed code. It manages memory, handles exceptions, performs garbage collection, and works with the JIT compiler.

2. Framework Class Library (FCL): The FCL provides reusable classes and methods for file handling, database connectivity, networking, collections, and user-interface development.

3. Common Type System (CTS): CTS defines common data types and rules for their use. It allows different .NET languages to understand compatible data types.

4. Common Language Specification (CLS): CLS defines a common subset of language features that promotes interoperability between .NET programming languages.

5. MSIL and JIT: Language compilers generate MSIL and metadata. The JIT compiler converts the required MSIL instructions into native machine code during execution.

Analysis and Conclusion

The layered architecture separates application code, reusable libraries, runtime services, and hardware-specific execution. This improves code reuse, type consistency, language interoperability, and memory management. However, the traditional .NET Framework is primarily Windows-oriented; modern .NET supports cross-platform development.

Expected Points and Marking Scheme

Expected PointMarks
Definition of .NET Framework0.5
Neat and correctly labelled diagram1.0
Explanation of CLR and FCL1.0
Explanation of CTS, CLS, MSIL, and JIT1.5
Analysis and conclusion1.0
Total5

2) Explain and evaluate the role of CLR, CTS, CLS, MSIL and JIT in the execution of a .NET application.

Ans.: The execution of a .NET application involves several components that work together to translate source code into executable machine instructions. CLR, CTS, CLS, MSIL, and JIT each have a distinct role in this process.

CLR (Common Language Runtime) provides the runtime environment for managed code. It manages application execution, memory, garbage collection, exception handling, and other runtime services.

CTS (Common Type System) defines the data types and rules used by .NET languages. For example, the C# int type corresponds to System.Int32.

CLS (Common Language Specification) defines common rules that support interoperability between different .NET languages. It allows public components written in one language to be used by another compatible language.

MSIL (Microsoft Intermediate Language) is the intermediate instruction set generated by a .NET language compiler. It is stored in an assembly along with metadata.

JIT (Just-In-Time) Compiler converts the required MSIL instructions into native machine code at runtime so that the processor can execute them.

Execution Diagram:

execution diagram asp.net

Evaluation

These components complement one another. MSIL provides a common intermediate representation, CTS supports type consistency, CLS promotes language interoperability, JIT produces native instructions, and CLR coordinates managed execution. Together, they support reusable components and a consistent runtime environment.

Expected Points and Marking Scheme

Expected PointMarks
Introduction to the execution process0.5
Role of CLR1.0
Roles of CTS and CLS1.0
Roles of MSIL and JIT1.5
Diagram and evaluation1.0
Total5

3) Analyze and justify how .NET provides langauge interoperability using CTS,CLS and CLR.

Ans.: Language interoperability is the ability of components written in different programming languages to work together within the same application or software system. .NET supports language interoperability through its common runtime environment, common type system, intermediate language, and language compatibility rules.

CTS defines common data types and rules for using them. For example, C# int and VB.NET Integer both correspond to System.Int32. This common representation allows compatible components to exchange data consistently.

CLS defines a subset of language features that .NET languages should follow when exposing components intended for use by other languages. Following CLS rules helps ensure that public methods, parameters, and return types are accessible across compatible .NET languages.

CLR provides the common execution environment. Compilers for supported .NET languages generate MSIL and metadata, which the CLR uses to execute the resulting assemblies.

Example

Suppose a reusable class library is developed in C#:

public class Calculator
{
    public int Add(int a, int b)
    {
        return a + b;
    }
}

A VB.NET application can reference the compiled class library and call its Add() method because both languages use compatible .NET types and runtime services.

Justification

Language interoperability reduces the need to rewrite existing components in another programming language. It encourages code reuse, supports integration between development teams, and allows developers to choose suitable languages for different tasks.

However, interoperability depends on compatible public interfaces and runtime support; not every language-specific feature is automatically available in every other language.

Expected Points and Marking Scheme

Expected PointMarks
Definition of language interoperability0.5
Explanation of CTS1.0
Explanation of CLS1.0
Role of CLR and MSIL1.0
Example and justification1.5
Total5

4) Compare and evaluate managed and unmanaged code with suitable examples and use cases.

Ans.: Managed and unmanaged code differ primarily in whether their execution is controlled by the CLR.

Managed code executes under the supervision of the CLR. The runtime provides services such as garbage collection, managed exception handling, type safety, and memory management for managed objects.

Unmanaged code executes outside CLR supervision, typically as native machine code under the operating system. Memory management and resource handling depend on the programming language and runtime facilities being used.

Comparison

BasisManaged CodeUnmanaged Code
ExecutionUnder CLR supervisionOutside CLR supervision
Memory managementCLR garbage collection for managed objectsDepends on language and runtime
Type safetyCLR supports runtime type safetyDepends on language and implementation
Exception handlingSupports managed exception handlingUses native exception mechanisms
DevelopmentReduces manual memory-management workMay require more explicit resource management
ExampleC# .NET applicationNative C/C++ application
Use caseBusiness applications and web applicationsOperating-system components and native libraries

Example:

Managed Code:

int number = 10;
Console.WriteLine(number);

When compiled and executed as a .NET application, this code runs under the CLR.

Unmanaged code:

#include <stdio.h>

int main()
{
    printf("Hello World");
    return 0;
}

When compiled as a native C program, the code executes without the .NET CLR.

Managed code is generally suitable for business applications because runtime services simplify memory management and improve reliability. Unmanaged code is useful when applications require direct interaction with native APIs, low-level system functionality, or specialized native libraries.

Neither approach is universally superior. The appropriate choice depends on performance requirements, resource-management needs, platform integration, and development complexity.

Expected Points and Marking Scheme

Expected PointMarks
Definition of managed and unmanaged code1.0
Comparison table1.5
Suitable examples1.0
Use cases0.5
Evaluation and conclusion1.0
Total5

5) Explain and evaluate the complete compilation and execution process of a .NET application.

A .NET application passes through compilation and execution stages before producing the desired output. The process separates language-specific compilation from processor-specific code generation.

First, the programmer writes source code in a language such as C#. The language compiler converts the source code into MSIL and metadata. These are packaged into an assembly, generally an .exe or .dll file.

When the application runs, the CLR loads the required assembly. The JIT compiler converts the required MSIL instructions into native machine code suitable for the target processor. The processor then executes the machine code.

During execution, the CLR also provides services such as memory management, garbage collection, exception handling, and runtime type safety.

Expected Points and Marking Scheme

Expected PointMarks
Introduction to compilation and execution0.5
Source code to MSIL1.0
Assembly generation and CLR loading1.0
JIT and native machine code execution1.5
Diagram and evaluation1.0
Total5

6) Analyze and justify the importance of JIT compilation in the .NET execution environment.

Ans.: JIT (Just-In-Time) compilation is the process of converting MSIL into native machine code at runtime. It is an important part of the .NET execution environment because processors execute native machine instructions rather than MSIL directly.

When a .NET application starts, the CLR loads its assembly. When a method needs to execute, the JIT compiler translates its MSIL instructions into machine code suitable for the target processor. The compiled code can then be reused during the application’s execution.

Example

Consider the following C# statement:

Console.WriteLine("Welcome to .NET");

The C# compiler generates MSIL for this operation. During execution, the JIT compiler converts the required instructions into native machine code, allowing the processor to perform the operation.

Importance

First, JIT compilation allows a common intermediate representation to be converted into code suitable for the target processor. Second, methods can generally be compiled as required rather than compiling every method into native code before execution. Third, the runtime can apply compilation optimizations appropriate to the target environment.

However, JIT compilation may introduce startup or first-use overhead. Its benefits depend on the application’s execution pattern and workload.

Expected Points and Marking Scheme

Expected PointMarks
Definition of JIT0.5
Explanation of how JIT works1.5
Suitable example or diagram1.0
Advantages of JIT1.0
Evaluation, including overhead1.0
Total5

7) Compare and evaluate private and shared assemblies. Recommend a suitable assembly type for a reusable component used by multiple applications.

Ans.: An assembly is a compiled unit of a .NET application containing MSIL, metadata, and other required information. Assemblies support application deployment, versioning, and code reuse.

A private assembly is intended for use by a particular application and is generally deployed in that application’s directory. A shared assembly is designed to be used by multiple applications. In the traditional .NET Framework, a shared assembly can be installed in the Global Assembly Cache (GAC).

Comparison

BasisPrivate AssemblyShared Assembly
Intended useOne applicationMultiple applications
DeploymentUsually in application directoryTraditionally in the GAC for shared use
ReusabilityPrimarily application-specificDesigned for reuse across applications
Version managementManaged with the applicationRequires careful management of shared versions
Strong nameNot normally required solely for private deploymentTypically used for GAC deployment
MaintenanceApplication-specific updatesShared updates must consider dependent applications

Recommendation and Justification

For a reusable component used by multiple applications in the traditional .NET Framework, a shared assembly is generally suitable. It allows multiple applications to use a common component without maintaining separate copies in every application directory.

For example, an organization may create a common logging library used by its billing, inventory, and student-management applications.

However, shared deployment requires careful version management because an incompatible update may affect multiple applications. If applications require different versions or independent release cycles, private deployment may be preferable.

Expected Points and Marking Scheme

Expected PointMarks
Definition of assembly0.5
Explanation of private assembly1.0
Explanation of shared assembly1.0
Comparison1.0
Recommendation with justification1.5
Total5

8) Explain and analyze Garbage Collection in .NET and evaluate its advantages over manual memory management.

Ans.: Garbage Collection (GC) is an automatic memory-management mechanism provided by the CLR. It identifies objects in managed memory that are no longer reachable by the application and reclaims the memory occupied by those objects.

When a .NET application creates objects, memory is allocated for them. As the application continues running, some objects may no longer be required. The garbage collector identifies eligible objects and reclaims their memory when a collection occurs.

Example:

class Student
{
    public string Name;
}

class Program
{
    static void Main()
    {
        Student s = new Student();
        s.Name = "Amit";

        s = null;
    }
}

If no other references to the Student object exist, the object becomes eligible for garbage collection after s is assigned null. However, collection is not necessarily immediate.

Advantages over Manual Memory Management

Garbage collection reduces the need for programmers to explicitly release memory for managed objects. It helps prevent errors caused by forgetting to free allocated memory and reduces the risk of certain invalid-memory-access problems.

Manual memory management, by comparison, can offer greater direct control but requires careful allocation and release of memory.

Garbage collection does not automatically guarantee the immediate release of external resources such as files, database connections, or network connections. These should be managed using mechanisms such as using statements and appropriate disposal methods.

Expected Points and Marking Scheme

Expected PointMarks
Definition of garbage collection0.5
Explanation of its working1.5
Suitable example1.0
Advantages over manual memory management1.0
Analysis and limitations1.0
Total5

9) Design a conceptual flow diagram showing how a C# program is converted into executable machine code in the .NET environment.

A C# program is converted into executable machine code through a sequence of compilation and execution stages. The C# compiler first converts source code into MSIL and metadata. These are stored in an assembly. When the application executes, the CLR loads the assembly and the JIT compiler converts the required MSIL instructions into native machine code.

Draw a diagram as given in above questions.

The C# compiler generates MSIL rather than directly generating processor-specific machine code. The assembly stores the intermediate instructions and metadata. The CLR manages execution, while the JIT compiler generates native code for the target processor. The processor then executes that code.

Importance

This process allows C# programs to use a common intermediate representation and benefit from runtime services. It also supports interoperability with other .NET languages that generate compatible assemblies.

Expected Points and Marking Scheme

Expected PointMarks
Correct source-code starting point0.5
Compiler and MSIL generation1.0
Assembly generation0.5
CLR and JIT stages1.5
Native machine code and explanation1.5
Total5

10) Evaluate the importance of CLR in providing a common execution environment for different .NET languages.

Ans.:

he Common Language Runtime (CLR) is the execution environment that manages the execution of .NET applications. It provides a common runtime for compatible assemblies produced by different .NET language compilers.

Languages such as C# and VB.NET have different syntax and language features, but their compilers can generate MSIL and metadata. The CLR loads these assemblies and works with the JIT compiler to convert MSIL into native machine code.

The CLR also provides common runtime services, including memory management, garbage collection, exception handling, and runtime type safety. CTS and CLS further support interoperability by providing common type rules and language compatibility conventions.

Example

A C# class library can provide a method that is called by a VB.NET application. Both components can work together when their public interfaces are compatible and both run in a suitable .NET environment.

Expected PointMarks
Definition of CLR0.5
Common execution environment1.0
MSIL and JIT relationship1.0
Runtime services1.0
Example and evaluation1.5
Total5

11) Analyze and justify why MSIL is generated instead of directly compiling every .NET language into machine code.

Ans.: MSIL (Microsoft Intermediate Language) is an intermediate instruction set generated by .NET language compilers. Instead of directly generating processor-specific machine code, a .NET compiler normally generates MSIL and metadata that are stored in an assembly.

At runtime, the CLR loads the assembly, and the JIT compiler converts the required MSIL instructions into native machine code suitable for the target processor.

Reasons for Generating MSIL

First, MSIL provides a common intermediate representation for different .NET languages. C#, VB.NET, and other supported languages can compile to compatible intermediate code.

Second, it supports language interoperability because compatible components can use common runtime and type-system conventions.

Third, MSIL allows native machine code to be generated for the target processor at runtime. This separates language-specific compilation from processor-specific code generation.

Finally, the CLR can provide runtime services such as memory management, exception handling, and type-safety checks where applicable.

Generating MSIL improves code reuse and language interoperability. However, it does not mean that every .NET application runs on every operating system automatically. Execution still requires a compatible runtime, supported libraries, and appropriate platform support.

Expected Points and Marking Scheme

Expected PointMarks
Definition of MSIL0.5
Explanation of the compilation process1.0
Support for multiple languages1.0
Runtime and processor-specific code generation1.0
Analysis and justification1.5
Total5

Scenario-Based / Higher-Order Questions

These are particularly useful because they move students beyond memorization.

Apply

1. A developer writes an application in C#. The compiler generates MSIL. Explain what should happen next for the program to execute.

2. An application needs to automatically manage unused memory. Identify the appropriate .NET mechanism and explain how it helps.

Analyze

3. Two applications need to use the same .NET component. Analyze whether a private or shared assembly would be more appropriate.

4. A developer claims that CTS and CLS perform exactly the same function. Examine this statement and explain whether it is correct.

Evaluate

5. A programmer prefers unmanaged code because it provides direct memory control. Evaluate the advantages and disadvantages of this approach compared with managed code.

6. A developer suggests removing JIT from the .NET execution process. Assess the impact of this decision.

Create

7. Design a diagram showing the complete flow:

C# Source Code → Compiler → MSIL → CLR/JIT → Native Code → Execution

8. Develop a real-world example demonstrating why a shared assembly may be useful in an organization.

Unit 2 – ASP.NET Controls, UI Design & Coding

This question bank is based on the Unit 2: ASP.NET Controls, UI Design & Coding includes following topics:

ASP.NET server controls: Controls, Buttons, TextBoxes, Labels, CheckBoxes, RadioButtons, List Controls, ImageMap Control, Web.config, Global.asax; Programming ASP.NET Web Pages: Web Pages, Data Types and Variables, Statements, Organizing Code, Object-Oriented Programming Basics of C#.

The questions use Bloom’s Taxonomy keywords so that the bank covers Remember, Understand, Apply, Analyze, Evaluate, and Create.

Multiple Choice Questions – 30

Remember / Understand

1. Which ASP.NET control is used to display text on a web page?
A. TextBox
B. Label
C. Button
D. CheckBox

2. Which control is used to accept text input from the user?
A. Label
B. TextBox
C. ImageMap
D. RadioButton

3. Which control is generally used to submit information to the server?
A. Label
B. Button
C. CheckBox
D. ListBox

4. Which control allows the user to select or deselect an option?
A. CheckBox
B. Label
C. TextBox
D. ImageMap

5. Which control is suitable when the user must select one option from a group of options?
A. CheckBox
B. RadioButton
C. TextBox
D. Label

6. Which control displays a list of selectable items?

7. Which ASP.NET control is used to create clickable regions on an image?

8. What is the purpose of the Web.config file?

9. What is the purpose of Global.asax?

10. Which property of a TextBox is commonly used to access the entered text?

11. Which property of a Button specifies the text displayed on it?

12. Which control is appropriate for selecting multiple independent options?

13. What is a data type?

14. What is a variable?

15. Which C# data type is used to store whole numbers?

16. Which C# data type is used to store true or false values?

17. What is a statement in C#?

18. Which programming concept combines data and methods into a single unit?

19. What is a class in C#?

20. What is an object?

Application-Oriented MCQs

21. A registration form needs a field for the student’s name. Which control would be most appropriate?

22. A form asks students to select Male or Female, where only one option should be selected. Which control is appropriate?

23. A form asks students to select multiple hobbies. Which control is appropriate?

24. A developer wants to provide a list of courses from which the user can select one course. Which control is suitable?

25. A website needs different parts of an image to act as hyperlinks. Which control can be used?

26. A developer wants to store application configuration information. Which file should be considered?

27. A developer wants to handle application-level events. Which ASP.NET file is relevant?

28. A program needs to store the age of a student. Which C# data type would normally be suitable?

29. A program needs to execute a group of statements repeatedly. Which programming construct should be considered?

30. A developer wants to create multiple objects with common properties and behavior. Which OOP concept should be used?

Answers

Answer Key: ASP.NET and C# MCQs

Q. No.Correct Answer
1B. Label
2B. TextBox
3B. Button
4A. CheckBox
5B. RadioButton
6ListBox
7ImageMap
8Stores application configuration settings.
9Handles application-level and session-level events.
10Text
11Text
12CheckBox
13A data type defines the kind of value a variable can store.
14A variable is a named memory location used to store data.
15int
16bool
17A statement is an instruction executed by a program.
18Encapsulation
19A class is a blueprint for creating objects.
20An object is an instance of a class.

Application-Oriented MCQs

Q. No.Correct Answer
21TextBox
22RadioButton
23CheckBox
24DropDownList
25ImageMap
26Web.config
27Global.asax
28int
29Looping construct (e.g., for, while, or do-while)
30Class

Important notes:

  • For Q. 6, a ListBox displays a list of selectable items.
  • For Q. 8, Web.config stores settings such as connection strings, authentication, and application configuration.
  • For Q. 9, Global.asax handles events such as Application_Start, Session_Start, and Application_End.
  • For Q. 11, the Text property specifies the text displayed on an ASP.NET Web Forms Button.
  • For Q. 30, a class defines common properties and behavior, while objects are individual instances of that class.

1-Mark Questions – 20

Bloom’s Level: Remember

Keywords: Define, State, Name, Identify, List

  1. Define an ASP.NET server control.
  2. What is a Button control?
  3. What is a Label control?
  4. What is a TextBox control?
  5. State the purpose of a CheckBox control.
  6. State the purpose of a RadioButton control.
  7. Name any two list controls available in ASP.NET.
  8. What is an ImageMap control?
  9. State the purpose of Web.config.
  10. What is Global.asax?
  11. Define a variable in C#.
  12. Define a data type.
  13. Name any four C# data types.
  14. What is a statement in C#?
  15. Define a class.
  16. Define an object.
  17. What is encapsulation?
  18. What is inheritance?
  19. What is polymorphism?
  20. State the purpose of organizing code in an ASP.NET application.

2-Mark Questions – 20

Bloom’s Level: Understand

Keywords: Explain, Describe, Differentiate, Identify

1) Explain the purpose of ASP.NET server controls.

Ans.: ASP.NET server controls are used to create interactive web page elements such as TextBox, Button, Label, and CheckBox. They run on the server and help in processing user input, handling events, and generating HTML for display in the browser.

2) Explain the use of the Button and Label controls.

– Button Control: Used to perform an action or submit user input when clicked. It can trigger a server-side event to execute code.

– Label Control: Used to display text or messages on a web page, such as instructions, headings, or results.

3) Differentiate between a Label and TextBox control.

Label ControlTextBox Control
Used to display text on a web page.Used to accept text input from users.
Generally displays read-only text.Allows users to enter or edit text.
Uses the Text property to set or retrieve displayed text.Uses the Text property to access entered text.
Example: Label1.Text = "Welcome";Example: TextBox1.Text = "Sanjay";

4) Explain the purpose of a TextBox control with an example.

Ans.: A TextBox control is used to accept input from users. It can accept names, addresses, numbers, and other text.

The Text property is used to retrieve or set the entered text.

Example:

ASPX Code:
<asp:TextBox ID="TextBox1" runat="server" />
<asp:Button ID="Button1" Text="Submit" runat="server" />
<asp:Label ID="Label1" runat="server" />

C#
protected void Button1_Click(object sender, EventArgs e)
{
    Label1.Text = "Welcome " + TextBox1.Text;
}

5) Differentiate between CheckBox and RadioButton controls.

Ans.:

CheckBoxRadioButton
Used to select or deselect an option.Used to select one option from a group.
Allows multiple independent selections.Normally allows only one selection within a group.
Each option can be selected independently.Selecting one option deselects another option in the same group.
Example: Selecting hobbies.Example: Selecting gender or payment mode.

6) Explain the use of RadioButton controls in a form.

Ans.: A RadioButton control allows users to select one option from a group of choices. It is useful for gender, payment mode, and yes/no questions. The GroupName property groups related radio buttons. The Checked property indicates whether an option is selected.

Example:

<asp:RadioButton ID="RBMale" runat="server"
    Text="Male" GroupName="Gender" />
<asp:RadioButton ID="RBFemale" runat="server"
    Text="Female" GroupName="Gender" />

7) Explain the purpose of list controls.

Ans.: List controls display a collection of items for users to select. They help users choose from predefined options.

Common ASP.NET list controls include DropDownList, ListBox, CheckBoxList, and RadioButtonList. They reduce manual data entry and improve data accuracy.

8) Differentiate between a DropDownList and ListBox.

Ans.:

DropDownListListBox
Displays options in a drop-down menu.Displays multiple options in a visible list.
Normally shows one selected item at a time.Can display multiple items simultaneously.
Generally allows one selection.Can allow multiple selections using SelectionMode="Multiple" in ASP.NET Web Forms.
Saves screen space.Requires more screen space.
Example: Selecting a course.Example: Selecting multiple subjects.

9) Explain the purpose of the ImageMap control.

Ans.:

  • The ImageMap control allows developers to create clickable regions on an image.
  • Each region is called a hot spot.
  • Different hot spots can perform different actions or navigate to different URLs.
  • It is useful for interactive maps, diagrams, and image-based navigation.

10) Describe the role of Web.config in an ASP.NET application.

Ans.:

  • Web.config is an XML configuration file used to configure an ASP.NET application.
  • It stores connection strings, authentication settings, authorization rules, and custom application settings.
  • It helps manage application behavior without changing source code.
  • It can contain database connection details and security-related configuration.

11) Explain the purpose of Global.asax.

Ans.:

  • Global.asax is used to handle application-level and session-level events in ASP.NET.
  • It contains event handlers that execute during application and session lifecycles.
  • Common events include:
    • Application_Start — executes when the application starts.
    • Session_Start — executes when a new session begins.
    • Application_Error — handles unhandled application errors.
    • Session_End — executes when a session ends, subject to hosting and session configuration.
  • It helps manage global application tasks.

12) Differentiate between Web.config and Global.asax.

Ans.:

Web.configGlobal.asax
Used to store application configuration settings.Used to handle application and session events.
Contains XML configuration data.Contains event-handling code.
Configures authentication, connection strings, and other settings.Handles events such as Application_Start and Application_Error.
Does not primarily contain event-handler logic.Does not primarily store configuration settings.

13) Explain the concept of data types in C#.

Ans.:

  • A data type specifies the kind of value a variable can store.
  • It determines the operations that can be performed on that value.
  • Data types help provide type safety in C#.
  • Common data types include:
    • int — stores whole numbers.
    • float — stores single-precision decimal numbers.
    • double — stores double-precision decimal numbers.
    • char — stores a single character.
    • string — stores text.
    • bool — stores true or false values.

Example:

int age = 20;
string name = "Rahul";
bool isActive = true;

14) Explain variables with a suitable C# example.

Ans.:

  • A variable is a named storage location used to hold data in a program.
  • Every variable has a data type and a name.
  • The value of a variable can be used or changed during program execution.
  • Variables make programs flexible and reusable.

Example:

int age = 20;
string name = "Rahul";

Console.WriteLine(name);
Console.WriteLine(age);

15) Describe different types of statements in C#.

Ans.:

A statement is an instruction executed by a program. Common types include:

  • Declaration statements: Declare variables, e.g., int age;
  • Assignment statements: Assign values, e.g., age = 20;
  • Selection statements: Make decisions using if, else, and switch.
  • Iteration statements: Repeat code using for, while, and do-while.
  • Jump statements: Change program flow using break, continue, and return.
  • Expression statements: Perform operations or method calls, e.g., Console.WriteLine("Hello");

16) Explain the importance of organizing code in an ASP.NET application.

Ans.:

  • Improves readability and makes code easier to understand.
  • Simplifies maintenance and future modifications.
  • Promotes code reusability through classes and methods.
  • Makes debugging and error detection easier.
  • Supports separation of concerns by keeping the user interface, business logic, and data access organized.
  • Improves teamwork and application development efficiency.

17) Define a class and object with an example.

Ans.:

Class: A blueprint that defines the properties and methods of objects.

Object: An instance of a class that can store data and perform operations.

Example:

class Student
{
    public string name;

    public void Display()
    {
        Console.WriteLine(name);
    }
}

Student s1 = new Student();
s1.name = "Rahul";
s1.Display();

18) Explain encapsulation in C#.

Ans.:

  • Encapsulation is an OOP concept that combines data and methods into a single unit.
  • It helps protect data by controlling access to class members.
  • Access modifiers such as private and public support encapsulation.
  • Properties can provide controlled access to private fields.

Example:

class Student
{
    private int age;

    public int Age
    {
        get { return age; }
        set { if (value > 0) age = value; }
    }
}

19) Explain inheritance in C#.

Ans.:

  • Inheritance allows one class to acquire accessible members of another class.
  • The existing class is called the base class.
  • The new class is called the derived class.
  • It promotes code reusability and supports hierarchical relationships.
  • C# supports single class inheritance, while multiple interfaces can be implemented.

Example:

class Animal
{
    public void Eat()
    {
        Console.WriteLine("Eating");
    }
}

class Dog : Animal
{
    public void Bark()
    {
        Console.WriteLine("Barking");
    }
}

20) Explain polymorphism in object-oriented programming.

Ans.:

Polymorphism is an object-oriented programming (OOP) concept that allows the same method or interface to exhibit different behaviors in different situations.

Key Points:

  1. Meaning: Polymorphism means one name, multiple forms.
  2. Types: It includes compile-time polymorphism (method overloading) and runtime polymorphism (method overriding).
  3. Advantages: It improves code reusability, flexibility, and maintainability.

Example in C#:

class Animal
{
    public virtual void Sound()
    {
        Console.WriteLine("Animal sound");
    }
}

class Dog : Animal
{
    public override void Sound()
    {
        Console.WriteLine("Bark");
    }
}

3-Mark Questions – 20

Bloom’s Level: Apply / Analyze

Keywords: Apply, Demonstrate, Illustrate, Compare, Analyze

1) Demonstrate how a TextBox and Button can be used to accept and process user input.

Ans.:

Expected points:

  1. TextBox: Accepts input from the user.
  2. Button: Triggers an event to process the entered data.
  3. Text property: Retrieves the entered text and displays the result.
ASPX code:
<asp:TextBox ID="txtName" runat="server" />
<asp:Button ID="btnSubmit" runat="server"
    Text="Submit" OnClick="btnSubmit_Click" />
<asp:Label ID="lblResult" runat="server" />'

C# Code:
protected void btnSubmit_Click(object sender, EventArgs e)
{
    lblResult.Text = "Welcome " + txtName.Text;
}

2) Illustrate the use of Label, TextBox and Button controls in a simple registration form.

Ans.:

Expected points:

  1. Label: Displays field names or instructions.
  2. TextBox: Accepts information such as the student’s name.
  3. Button: Submits the form and processes the entered information.

Example:

ASPX CodeL
<asp:Label ID="lblName" runat="server"
    Text="Student Name:" />
<asp:TextBox ID="txtName" runat="server" />
<asp:Button ID="btnRegister" runat="server"
    Text="Register" OnClick="btnRegister_Click" />
<asp:Label ID="lblMessage" runat="server" />

C# code:
protected void btnRegister_Click(object sender, EventArgs e)
{
    lblMessage.Text = "Registration: " + txtName.Text;
}

3) Compare CheckBox and RadioButton controls using suitable real-world examples.

Ans.:

Expected points:

  1. CheckBox: Allows users to select multiple independent options.
  2. RadioButton: Normally allows only one selection within a group.
  3. Real-world examples: CheckBox for selecting hobbies; RadioButton for selecting a payment method.
CheckBoxRadioButton
Multiple options can be selected.One option can be selected per group.
Options work independently.Options are grouped using GroupName.
Example: Cricket, Music, Reading.Example: Cash, Card, UPI.

4) Demonstrate how a DropDownList can be used to allow a student to select a course.

Ans.:

Expected points:

  1. DropDownList: Displays a list of available courses.
  2. ListItem: Defines each course option.
  3. SelectedValue: Retrieves the value of the selected course.

Example:

ASPX Code:
<asp:DropDownList ID="ddlCourse" runat="server">
    <asp:ListItem Value="BCA">BCA</asp:ListItem>
    <asp:ListItem Value="MCA">MCA</asp:ListItem>
    <asp:ListItem Value="BScIT">B.Sc. IT</asp:ListItem>
</asp:DropDownList>

<asp:Button ID="btnSelect" runat="server"
    Text="Select Course" OnClick="btnSelect_Click" />
<asp:Label ID="lblCourse" runat="server" />

C# Code:
protected void btnSelect_Click(object sender, EventArgs e)
{
    lblCourse.Text = ddlCourse.SelectedValue;
}

5) Illustrate the use of a ListBox in an ASP.NET application.

Ans.:

Expected points:

  1. ListBox: Displays multiple items in a visible list.
  2. Users can select one or multiple items, depending on its configuration.
  3. The SelectedItem or SelectedItems collection can be used to retrieve selections.

Example:

<asp:ListBox ID="lstSubjects" runat="server"
    SelectionMode="Multiple">
    <asp:ListItem>Java</asp:ListItem>
    <asp:ListItem>Python</asp:ListItem>
    <asp:ListItem>ASP.NET</asp:ListItem>
</asp:ListBox>

6) Analyze the difference between single-selection and multiple-selection controls.

Ans.:

Expected points:

  1. Single-selection controls: Allow the user to select only one item.
  2. Multiple-selection controls: Allow the user to select more than one item.
  3. Applications: Course selection may use a DropDownList; hobby selection may use CheckBox controls or a multiple-selection ListBox.
Single SelectionMultiple Selection
Selects one item at a time.Selects several items.
Example: DropDownList.Example: CheckBoxList.
Suitable for one course or payment method.Suitable for hobbies or optional subjects.

7) Demonstrate a suitable application of the ImageMap control.

Ans.:

Expected points:

  1. ImageMap: Creates clickable regions on an image.
  2. HotSpot: Defines a clickable area, such as a rectangle, circle, or polygon.
  3. Navigation: Each region can redirect the user to a different page.

Example:

ASPX Code:
<asp:ImageMap ID="imgCampus" runat="server"
    ImageUrl="~/Images/campus.jpg">
    <asp:RectangleHotSpot
        Left="10" Top="10" Right="100" Bottom="80"
        NavigateUrl="Library.aspx"
        AlternateText="Library" />
</asp:ImageMap>

Application: Different buildings on a campus map can link to their respective information pages.

8) Analyze the purpose of Web.config and identify the type of information that can be maintained in it.

Ans.:

Expected points:

  1. Configuration: Web.config stores settings that control an ASP.NET application’s behavior.
  2. Connection strings: It can store database connection configuration.
  3. Security and application settings: It can define authentication, authorization, custom settings, and other configuration options.

Example:

<configuration>
  <appSettings>
    <add key="InstituteName" value="ABC College" />
  </appSettings>
</configuration>

The setting can be retrieved using ConfigurationManager.AppSettings["InstituteName"].

9) Analyze the role of Global.asax in an ASP.NET application.
Ans.:

Expected points:

  1. Application events: Handles events related to application startup and shutdown.
  2. Session events: Handles events such as the beginning of a new session.
  3. Error handling: The Application_Error event can handle unhandled application errors.

Examples of events:

  • Application_Start
  • Session_Start
  • Application_Error
  • Application_End

Example:

void Application_Start(object sender, EventArgs e)
{
Application["VisitorCount"] = 0;
}

This code initializes an application-level variable when the application starts.

10) Compare Web.config and Global.asax based on their purpose.

Ans.:

Expected points:

  1. Web.config: Maintains application configuration settings.
  2. Global.asax: Contains handlers for application and session lifecycle events.
  3. Format and usage: Web.config primarily contains XML settings, while Global.asax contains event-handling code.
Web.configGlobal.asax
Stores configuration settings.Handles lifecycle events.
Contains XML configuration.Contains event-handler code.
Example: Authentication settings.Example: Application_Start.

11) Apply suitable C# data types to represent a student’s name, age, percentage, and pass/fail status.

Ans.:

Expected points:

  1. string: Stores the student’s name.
  2. int and double: Store age and percentage, respectively.
  3. bool: Stores the pass/fail status as true or false.

Example:

string name = "Rahul";
int age = 20;
double percentage = 85.5;
bool isPassed = true;

12) Demonstrate variable declaration and initialization using C#.

Ans.:

Expected points:

  1. Variable declaration: Specifies the variable’s data type and name.
  2. Initialization: Assigns an initial value to the variable.
  3. Usage: Variables store data that can be used or modified during program execution.

Example:

int age;           // Declaration
age = 20;          // Assignment

string name = "Rahul";  // Declaration and initialization

Console.WriteLine(name);
Console.WriteLine(age);

13) Illustrate the use of conditional statements in a C# program.

Ans.:

Expected points:

  1. Conditional statements: Execute different code depending on whether a condition is true or false.
  2. if and else: Select between alternative blocks of code.
  3. Application: Can determine whether a student has passed an examination.

Example:

int marks = 65;

if (marks >= 40)
{
    Console.WriteLine("Pass");
}
else
{
    Console.WriteLine("Fail");
}

14) Apply an appropriate looping statement to display numbers from 1 to 10.

Ans.:

Expected points:

  1. Looping statement: Repeats a block of code.
  2. for loop: Uses initialization, a condition, and an update expression.
  3. Iteration: Repeats the statement until the condition becomes false.

Example:

for (int i = 1; i <= 10; i++)
{
    Console.WriteLine(i);
}

15) Analyze the importance of proper code organization in a web application.

Ans.:

Expected points:

  1. Readability: Makes code easier to understand.
  2. Maintainability and debugging: Helps developers locate and correct errors.
  3. Reusability: Classes and methods can be reused in different parts of the application.
  4. Separation of concerns: Keeps the user interface, business logic, and data access appropriately separated.
  5. Teamwork: Makes collaborative development easier.
  6. Scalability: Supports future changes and application growth.

16) Demonstrate how a class can be used to represent a Student.

Ans.:

Expected points:

  1. Class: Acts as a blueprint for creating student objects.
  2. Properties or fields: Store student information such as name and roll number.
  3. Methods: Define operations that a student object can perform.

Example:

class Student
{
    public string Name;
    public int RollNo;

    public void Display()
    {
        Console.WriteLine(Name);
        Console.WriteLine(RollNo);
    }
}

17) Illustrate the relationship between a class and an object.

Ans.:

Expected points:

  1. Class: A blueprint that defines properties and methods.
  2. Object: An instance of a class created using the new keyword.
  3. Relationship: Objects use the members defined by their class.

Example:

class Student
{
    public string Name;
}

Student s1 = new Student();
s1.Name = "Rahul";

Console.WriteLine(s1.Name);


18) Analyze how encapsulation improves the design of a C# program.

Ans.:

Expected points:

  1. Data protection: Restricts direct access to internal data using access modifiers such as private.
  2. Controlled access: Properties and methods provide controlled ways to read or modify data.
  3. Validation: Helps prevent invalid values from being assigned.
  4. Maintainability: Internal implementation can be modified without unnecessarily changing code that uses the class.
  5. Reliability: Helps maintain valid object states.

Example:

class Student
{
    private int age;

    public int Age
    {
        get { return age; }
        set
        {
            if (value > 0)
                age = value;
        }
    }
}

Here, age is private, and the Age property permits only positive values to be assigned.


19) Compare class and object with a real-world example.

Ans.:

Expected points:

  1. Class: A blueprint that defines the common properties and behavior of similar entities.
  2. Object: A specific instance created from that blueprint.
  3. Real-world example: Car is a class, while a particular red Honda car is an object of that class.
ClassObject
Defines properties and methods.Has actual values for its data members.
Acts as a blueprint.Represents an individual instance.
Example: Student.Example: a student named Rahul.

20) Demonstrate the use of an object to access members of a C# class.

Ans.:

Expected points:

  1. Object creation: Create an instance of a class using the new keyword.
  2. Member access: Use the dot (.) operator to access accessible fields, properties, and methods.
  3. Execution: Call the object’s method to perform the defined operation.

Example:

class Student
{
    public string Name;

    public void Display()
    {
        Console.WriteLine(Name);
    }
}

Student s1 = new Student();
s1.Name = "Rahul";
s1.Display();

5-Mark Questions – 20

Bloom’s Level: Evaluate / Create

Keywords: Evaluate, Justify, Design, Develop, Propose, Construct

1) Design an ASP.NET student registration form using appropriate server controls. Explain the purpose of each control.\

Ans.:

An ASP.NET student registration form collects student details using server controls and processes the submitted information on the server.

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

Gender:
<asp:RadioButton ID="rbMale" runat="server"
    Text="Male" GroupName="Gender" />
<asp:RadioButton ID="rbFemale" runat="server"
    Text="Female" GroupName="Gender" />

Course:
<asp:DropDownList ID="ddlCourse" runat="server">
    <asp:ListItem>BCA</asp:ListItem>
    <asp:ListItem>MCA</asp:ListItem>
</asp:DropDownList>

<asp:CheckBox ID="chkTerms" runat="server"
    Text="I agree to the terms" />

<asp:Button ID="btnRegister" runat="server"
    Text="Register" />

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

Purpose of controls:

  • TextBox: Accepts the student’s name.
  • RadioButton: Allows selection of one gender option within a group.
  • DropDownList: Displays available courses.
  • CheckBox: Records agreement to the terms.
  • Button: Initiates the registration process.
  • Label: Displays a confirmation message.

Marks bifurcation:

Expected pointMarks
Form design and relevant controls2
Explanation of control purposes2
Appropriate overall design1
Total5

2) Develop a conceptual ASP.NET form using Label, TextBox, RadioButton, CheckBox, DropDownList and Button controls. Explain the purpose of each control.

Ans.:

A conceptual student-information form can use the following controls:

<asp:Label ID="lblName" runat="server"
    Text="Student Name:" />

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

<asp:RadioButton ID="rbMale" runat="server"
    Text="Male" GroupName="Gender" />

<asp:RadioButton ID="rbFemale" runat="server"
    Text="Female" GroupName="Gender" />

<asp:CheckBox ID="chkSports" runat="server"
    Text="Interested in Sports" />

<asp:DropDownList ID="ddlCourse" runat="server">
    <asp:ListItem>BCA</asp:ListItem>
    <asp:ListItem>MCA</asp:ListItem>
</asp:DropDownList>

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

Purpose of each control:

  1. Label: Displays field names and instructions.
  2. TextBox: Accepts the student’s name.
  3. RadioButton: Allows one choice from a group.
  4. CheckBox: Allows an independent option to be selected.
  5. DropDownList: Provides predefined course choices.
  6. Button: Initiates form processing when clicked.

Marks bifurcation:

Expected pointMarks
Correct use of controls in form design2
Explanation of control purposes2
Appropriate application1
Total5

3) Compare and evaluate CheckBox and RadioButton controls and justify their selection for different real-world applications.

Ans.:

Expected answer:

CheckBox and RadioButton are ASP.NET server controls used to collect user choices, but they differ in selection behavior.

BasisCheckBoxRadioButton
SelectionMultiple independent optionsOne option per group
BehaviorEach option can be selected independentlySelecting one option deselects another in the same group
Real-world useSelecting hobbies or skillsSelecting a payment method
SuitabilityWhen choices are independentWhen choices are mutually exclusive

Justification:

  • Use CheckBox controls when a user may select multiple skills, such as Java, Python, and SQL.
  • Use RadioButton controls when only one payment method, such as cash or card, should be selected.
  • Choosing the appropriate control improves usability and accuracy of user input.

Marks bifurcation:

Expected pointMarks
Explanation of both controls1
Three valid comparisons2
Suitable real-world examples1
Justification of selection1
Total5

4) Design an ASP.NET form for employee information and select appropriate controls for name, gender, department, skills and submission.

Ans.:

An employee-information form should use controls according to the type of data being collected.

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

Gender:
<asp:RadioButton ID="rbMale" runat="server"
    Text="Male" GroupName="Gender" />
<asp:RadioButton ID="rbFemale" runat="server"
    Text="Female" GroupName="Gender" />

Department:
<asp:DropDownList ID="ddlDepartment" runat="server">
    <asp:ListItem>IT</asp:ListItem>
    <asp:ListItem>HR</asp:ListItem>
    <asp:ListItem>Finance</asp:ListItem>
</asp:DropDownList>

Skills:
<asp:CheckBoxList ID="cblSkills" runat="server">
    <asp:ListItem>C#</asp:ListItem>
    <asp:ListItem>SQL</asp:ListItem>
    <asp:ListItem>ASP.NET</asp:ListItem>
</asp:CheckBoxList>

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

Control selection and justification:

  1. TextBox: Accepts the employee’s name.
  2. RadioButton: Allows one gender option to be selected.
  3. DropDownList: Allows selection of one department.
  4. CheckBoxList: Allows selection of multiple skills.
  5. Button: Initiates submission and processing of employee information.

Marks bifurcation:

Expected pointMarks
Suitable form design2
Correct control selection2
Justification of selections1
Total5

5) Explain and evaluate different ASP.NET list controls and recommend suitable controls for different requirements.

6) Explain and analyze the ImageMap control and design a suitable real-world application for it.

7) Explain and evaluate the role of Web.config and Global.asax in an ASP.NET application.

8) Design a conceptual ASP.NET application architecture showing where Web.config and Global.asax are used.

9) Develop a C# program that uses appropriate data types and variables to store and display student information.

10) Design a C# program using conditional and looping statements to process student marks and display an appropriate result.

11) Analyze and evaluate the importance of data types, variables and statements in developing ASP.NET applications.

12) Design a C# class named Student containing suitable data members and methods. Explain how objects of the class can be created.

13) Develop a conceptual example demonstrating the relationship between class, object, properties and methods.

14) Explain and evaluate the four major OOP concepts—encapsulation, abstraction, inheritance and polymorphism—with suitable C# examples.

15) Design a simple object-oriented model for a Student Management System using appropriate classes and objects.

16) Evaluate the advantages of using OOP concepts while developing large ASP.NET applications.

17) Construct a conceptual ASP.NET page that accepts student details, processes the input and displays the result.

18) Design and explain an ASP.NET application in which multiple server controls work together to collect user information.

19) Propose an appropriate set of ASP.NET controls for an online course-registration form and justify each selection.

20) Develop and explain a complete conceptual solution for an ASP.NET student registration page using controls, C# variables, statements and OOP concepts.

Scenario-Based / Higher-Order Questions

These are valuable for Apply, Analyze, Evaluate and Create levels.

Apply

1. You are developing a student registration form. The form requires Name, Gender, Course, Hobbies and Submit. Select appropriate ASP.NET controls for each field and justify your selection.

2. A user must select exactly one course from ten available courses. Identify and apply the most appropriate ASP.NET control.

3. A user can select several programming languages that they know. Select an appropriate control and explain why.

4. A webpage contains an image of a college campus, and different areas of the image should open different pages. Identify the appropriate ASP.NET control.

Analyze

5. A developer has used CheckBox controls where RadioButtons were required. Analyze the problem and recommend a suitable solution.

6. An application contains configuration information directly inside several ASP.NET pages. Analyze the problem and explain how Web.config can improve the design.

7. An ASP.NET application has become difficult to maintain because all code is placed in one large file. Analyze the problem and suggest suitable code-organization practices.

Evaluate

8. A developer wants to use TextBox controls for every input, including gender and course selection. Evaluate this design and recommend better controls.

9. A developer claims that OOP is unnecessary for small ASP.NET applications. Evaluate this statement with suitable arguments.

10. A programmer has to decide whether to represent a Student as a collection of unrelated variables or as a class. Evaluate both approaches and recommend one.

Create

11. Design a Student Registration System interface using at least five different ASP.NET controls.

12. Develop a conceptual C# class model for a Library Management System containing suitable classes, objects, properties and methods.

13. Design an ASP.NET page that accepts marks of a student, processes them using C# statements and displays the result.

14. Construct a conceptual Employee Registration application using suitable ASP.NET controls and C# OOP concepts.

15. Propose a suitable control layout for an online examination registration form and explain your design choices.

Unit 3 – ASP.NET Validation Controls, State Management & Navigation

Based on the Unit 3 syllabus the topics are as follows:

Validation Controls: Controls, Basic Validation Controls, Validation Techniques, Advanced Validation Controls
State Management: ViewState, Session State, Application State, Cookies, URL Encoding
Master Pages: Creating Master Pages, Content Pages, Nesting Master Pages, Accessing Master Page Controls from Content Pages
Themes: Skin File and CSS
Navigation: Site Navigation, Site Navigation Controls

The questions below deliberately use Bloom’s Taxonomy keywords and cover the complete syllabus.

Multiple Choice Questions – 30

Remember / Understand

1. What is the primary purpose of ASP.NET validation controls?
A. Database management
B. Input validation
C. Page navigation
D. Session creation

2. Which validation control ensures that a required field is not left empty?
A. CompareValidator
B. RequiredFieldValidator
C. RangeValidator
D. CustomValidator

3. Which validation control checks whether a value falls within a specified range?
A. RangeValidator
B. RegularExpressionValidator
C. RequiredFieldValidator
D. ValidationSummary

4. Which validation control compares the value entered in one control with another value or control?
A. RangeValidator
B. CompareValidator
C. CustomValidator
D. RequiredFieldValidator

5. Which validation control is commonly used to validate an email address using a pattern?
A. RangeValidator
B. RegularExpressionValidator
C. CompareValidator
D. ValidationSummary

6. Which control allows developers to implement custom validation logic?
A. CustomValidator
B. RequiredFieldValidator
C. RangeValidator
D. CompareValidator

7. What is the purpose of ValidationSummary?

8. What is state management in ASP.NET?

9. Which state management technique stores information in the page itself?

10. Which state management technique is associated with an individual user’s session?

11. Which state management technique can store information accessible to all users of an application?

12. What is a cookie?

13. What is URL encoding?

14. Which state management technique is generally maintained on the server?

15. Which state management technique is stored on the client side?

16. What is a Master Page?

17. What is a Content Page?

18. What is a nested Master Page?

19. What is a Theme in ASP.NET?

20. What is a Skin File?

Application-Oriented MCQs

21. A registration form must ensure that the user’s name is entered. Which validator should be used?

22. A student must enter marks between 0 and 100. Which validation control is appropriate?

23. A password and confirm-password field must contain the same value. Which validator is appropriate?

24. A website wants to validate an email address according to a specific pattern. Which validator should be considered?

25. A website needs to preserve a control’s value after a postback. Which state-management technique is appropriate?

26. A shopping cart needs to maintain information for an individual user during a visit. Which state-management technique is most appropriate?

27. A website needs to maintain a value that is common to all users. Which state-management technique should be considered?

28. Several pages of a website need the same header, footer and navigation. Which ASP.NET feature is most appropriate?

29. A developer wants to apply a common visual design to several ASP.NET pages. Which feature should be considered?

30. A website needs a structured hierarchy of pages and navigation links. Which ASP.NET feature is appropriate?

1-Mark Questions – 20

Bloom’s Level: Remember

Keywords: Define, State, Name, Identify, List

  1. Define validation in ASP.NET.
  2. What is a validation control?
  3. Name any four ASP.NET validation controls.
  4. State the purpose of RequiredFieldValidator.
  5. What is RangeValidator?
  6. What is CompareValidator?
  7. State the purpose of RegularExpressionValidator.
  8. What is CustomValidator?
  9. What is ValidationSummary?
  10. Define state management.
  11. What is ViewState?
  12. What is Session State?
  13. What is Application State?
  14. Define a cookie.
  15. What is URL encoding?
  16. Define a Master Page.
  17. What is a Content Page?
  18. Define a Theme.
  19. What is a Skin File?
  20. What is site navigation?

2-Mark Questions – 20

Bloom’s Level: Understand

Keywords: Explain, Describe, Differentiate, Summarize

  1. Explain the purpose of validation controls in ASP.NET.
  2. Explain the working of RequiredFieldValidator.
  3. Differentiate between RangeValidator and CompareValidator.
  4. Explain the purpose of RegularExpressionValidator.
  5. Explain the use of CustomValidator.
  6. Describe the purpose of ValidationSummary.
  7. Explain the concept of state management.
  8. Differentiate between client-side and server-side state management.
  9. Explain ViewState with a suitable example.
  10. Explain Session State and its purpose.
  11. Differentiate between Session State and Application State.
  12. Explain the purpose of cookies in ASP.NET.
  13. Explain URL encoding and its purpose.
  14. Explain the concept of Master Pages.
  15. Differentiate between Master Page and Content Page.
  16. Explain nested Master Pages.
  17. Explain the purpose of Themes in ASP.NET.
  18. Differentiate between a Skin File and CSS.
  19. Explain site navigation in ASP.NET.
  20. Describe the purpose of site navigation controls.

3-Mark Questions – 20

Bloom’s Level: Apply / Analyze

Keywords: Apply, Demonstrate, Illustrate, Compare, Analyze, Classify

  1. Demonstrate how RequiredFieldValidator can be used in a registration form.
  2. Apply RangeValidator to validate student marks between 0 and 100.
  3. Illustrate the use of CompareValidator for password and confirm-password fields.
  4. Demonstrate how RegularExpressionValidator can be used to validate an email address.
  5. Compare basic and advanced validation techniques in ASP.NET.
  6. Analyze the need for server-side validation even when client-side validation is available.
  7. Illustrate the difference between ViewState and Session State using suitable scenarios.
  8. Apply Session State to maintain a user’s shopping-cart information.
  9. Analyze when Application State should be preferred over Session State.
  10. Demonstrate how cookies can be used to remember a user’s preference.
  11. Illustrate a situation where URL encoding is required.
  12. Compare ViewState, Session, Application State and Cookies.
  13. Demonstrate how a Master Page can provide a common layout for multiple Content Pages.
  14. Illustrate the relationship between a Master Page and a Content Page.
  15. Analyze the benefits of using nested Master Pages.
  16. Demonstrate how a Content Page can access a control placed on a Master Page.
  17. Apply a Theme to provide a consistent appearance across multiple pages.
  18. Illustrate the role of Skin Files in ASP.NET Themes.
  19. Analyze the importance of site navigation in a multi-page web application.
  20. Demonstrate how navigation controls can be used to create a structured website menu.

4-Mark Questions – 20

Bloom’s Level: Analyze / Evaluate

Keywords: Analyze, Compare, Examine, Assess, Justify, Differentiate

  1. Analyze the different ASP.NET validation controls and explain their appropriate use.
  2. Compare and analyze RequiredFieldValidator, RangeValidator and CompareValidator.
  3. Examine the role of RegularExpressionValidator in validating structured input.
  4. Analyze the advantages and limitations of CustomValidator.
  5. Assess the importance of validation in preventing incorrect user input.
  6. Analyze client-side and server-side validation techniques.
  7. Compare and analyze ViewState, Session State, Application State and Cookies.
  8. Analyze the advantages and limitations of ViewState.
  9. Compare Session State and Application State with suitable real-world scenarios.
  10. Examine the advantages and limitations of cookies for state management.
  11. Analyze the role of URL encoding in transferring information through URLs.
  12. Assess how appropriate state-management selection can affect an ASP.NET application’s performance and behavior.
  13. Analyze the architecture and purpose of Master Pages and Content Pages.
  14. Compare Master Pages and Themes based on their purpose.
  15. Examine the advantages of nested Master Pages in large websites.
  16. Analyze how a Content Page can access controls defined in a Master Page.
  17. Compare and analyze Skin Files and CSS in ASP.NET website design.
  18. Assess the importance of consistent Themes in web application design.
  19. Analyze the role of site navigation controls in a multi-page ASP.NET application.
  20. Examine how Master Pages, Themes and Navigation can work together to create a consistent website.

5-Mark Questions – 20

Bloom’s Level: Evaluate / Create

Keywords: Evaluate, Justify, Design, Develop, Construct, Propose

  1. Explain and analyze the different ASP.NET validation controls with suitable examples and use cases.
  2. Design an ASP.NET registration form using RequiredFieldValidator, RangeValidator, CompareValidator and RegularExpressionValidator. Explain the purpose of each validator.
  3. Evaluate the importance of input validation in web applications and justify the use of different validation controls for different input requirements.
  4. Design a validation strategy for an online examination registration form and select appropriate validators for each field.
  5. Compare and evaluate client-side and server-side validation and justify when each approach should be used.
  6. Explain and evaluate ViewState, Session State, Application State and Cookies with suitable scenarios.
  7. Design a state-management strategy for an online shopping application. Justify which technique should be used for user preferences, shopping cart information and application-wide data.
  8. Evaluate the advantages and limitations of ViewState and Session State in ASP.NET applications.
  9. Analyze and justify the use of Cookies and URL encoding in web applications.
  10. Design a conceptual ASP.NET application demonstrating the use of ViewState, Session and Application State for different requirements.
  11. Design a Master Page containing a common header, navigation menu and footer, and explain how Content Pages can use it.
  12. Develop a conceptual website structure using a Master Page and multiple Content Pages. Explain the relationship between them.
  13. Design and explain a nested Master Page structure for a college website having common university-level and department-level layouts.
  14. Evaluate the advantages of Master Pages over designing the same layout independently on every page.
  15. Design an ASP.NET Theme using Skin Files and CSS for maintaining a consistent website appearance.
  16. Compare and evaluate Skin Files and CSS and justify their appropriate use in ASP.NET applications.
  17. Design a site-navigation structure for a college website containing Home, About, Courses, Faculty, Admissions and Contact pages.
  18. Explain and evaluate the role of site navigation controls in improving the usability of an ASP.NET website.
  19. Develop a conceptual design combining Master Pages, Themes and Navigation Controls for a multi-page ASP.NET website.
  20. Design and explain a complete ASP.NET website architecture that uses validation controls, state management, Master Pages, Themes and navigation features.

Scenario-Based / Higher-Order Questions

These are especially useful for Apply, Analyze, Evaluate and Create levels.

Apply

1. A registration form contains Name, Age, Email, Password and Confirm Password. Select an appropriate validation control for each field and justify your selection.

2. A student enters marks that must be between 0 and 100. Apply a suitable validation technique.

3. A user enters a password and must enter it again for confirmation. Identify and apply the appropriate validator.

4. A shopping website needs to remember items selected by a user during the current visit. Select an appropriate state-management technique.

5. A website wants to remember a user’s preferred language even after the browser is reopened. Identify an appropriate state-management approach.

Analyze

6. A developer uses Application State to store every user’s shopping cart. Analyze whether this is an appropriate choice.

7. A developer stores a large amount of information in ViewState. Analyze the possible impact on the application.

8. A website has ten pages, each containing a separately designed header and footer. Analyze the maintenance problem and recommend an ASP.NET feature.

9. A website has a common college layout but each department needs its own additional layout. Analyze how nested Master Pages could solve the problem.

10. A website has different colors and fonts on every page. Analyze how Themes, Skin Files and CSS could improve consistency.

Evaluate

11. A developer argues that cookies should always be used instead of Session State because cookies are simpler. Evaluate this statement.

12. A developer wants to rely only on client-side validation. Evaluate this approach and justify whether additional validation is required.

13. A website developer proposes creating a separate header and navigation menu for every page. Evaluate the proposal and recommend a better design.

14. A developer uses ViewState to store application-wide information. Evaluate this approach and recommend a suitable alternative.

15. A website has no structured navigation because every page links randomly to other pages. Evaluate the impact on usability and propose a solution.

Create

16. Design a complete validation plan for an online student registration system.

17. Design a state-management model for an e-commerce application showing where ViewState, Session, Application State and Cookies could be used.

18. Construct a Master Page and Content Page hierarchy for a university website.

19. Design a Theme containing common styling requirements for a college website using Skin Files and CSS.

20. Develop a conceptual navigation structure for a five-section educational website using ASP.NET navigation features.

ASP.NET Study Resources

For technical reference, Microsoft’s documentation remains a useful authoritative source for ASP.NET Web Forms concepts, including server controls, validation, Master Pages and navigation.

Follow this link: Microsoft Learn – ASP.NET

What is an ASP.NET Question Bank?

An ASP.NET question bank is a structured collection of questions covering ASP.NET concepts, programming, controls, validation, state management and other syllabus topics.

How many questions are included?

The planned question bank contains 500+ questions across five units, including MCQs, 1-mark, 2-mark, 3-mark, 4-mark, 5-mark and application-based questions.

Are the questions based on Bloom’s Taxonomy?

Yes. Questions are organized using Bloom’s Taxonomy levels such as Remember, Understand, Apply, Analyze, Evaluate and Create.

Does the question bank contain 5-mark questions?

Yes. Each unit will contain a dedicated collection of 5-mark and higher-order questions.

Is the question bank useful for university examinations?

It is designed for syllabus-based examination preparation, revision and practice. However, no question bank can guarantee the exact questions appearing in an examination.

Leave a Comment