1.
The .NET Framework provides a runtime environment called ?
Correct Answer
B. CLR
Explanation
The correct answer is CLR (Common Language Runtime). The .NET Framework includes CLR, which provides the runtime environment for executing managed code. It manages memory, handles exceptions, and provides various services for running applications written in different programming languages. CLR also includes a Just-In-Time (JIT) compiler that converts Intermediate Language (IL) code into machine code at runtime for efficient execution.
2.
In ASP.NET in form page the object which contains the user name is ?
Correct Answer
A. Page.User.Identity
Explanation
The correct answer is Page.User.Identity. In ASP.NET, the object that contains the user name is accessed using the Page.User.Identity property. This property provides information about the current user, including their name, authentication type, and whether they are authenticated or not. The Page.User.Identity property is commonly used for user authentication and authorization purposes in ASP.NET applications.
3.
In an ASPX page lifecycle, Which event is triggered first?
Correct Answer
B. PageInit
Explanation
In an ASPX page lifecycle, the PageInit event is triggered first. This event occurs before the page is initialized and allows for any initialization tasks to be performed. It is typically used to set initial values for controls or perform any necessary setup before the page is fully loaded.
4.
What is the Use of Global.asax
Correct Answer
A. Program Application & Session level events
Explanation
The Global.asax file is used to handle program application and session level events in a web application. It allows developers to write code that runs during specific events such as application start, end, session start, session end, etc. This file is useful for managing the application's lifecycle and performing tasks like initializing global variables, setting up session variables, and managing application-wide events. It does not have any direct functionality related to getting notified when a global variable is changed, setting global layout, or configuring server performance.
5.
How do you manage states?
Correct Answer(s)
A. Viewstate
B. Session Object
C. Application Object
Explanation
The correct answer includes multiple options for managing states in a web application. Viewstate is used to store the state of individual controls on a web page. Session Object is used to store user-specific data that can be accessed across multiple pages within a session. Application Object is used to store data that can be accessed by all users of the application. Out of process StateServer is a mechanism to store session data in a separate process, allowing for better scalability and fault tolerance.
6.
Where is default session data is stored?
Correct Answer
A. In Process
Explanation
The default session data is stored "In Process", which means that it is stored directly in the memory of the web server hosting the application. This allows for quick and efficient access to the session data. However, it also means that if the web server restarts or crashes, the session data will be lost.
7.
What method is used to ensure that only one process accesses a variable at a time?
Correct Answer
C. Lock() & Unlock()
Explanation
The method used to ensure that only one process accesses a variable at a time is by using the Lock() & Unlock() mechanism. This method allows a process to acquire a lock on the variable, preventing other processes from accessing it until the lock is released. This ensures that only one process has exclusive access to the variable at any given time, preventing any potential conflicts or inconsistencies that could arise from concurrent access.
8.
The .NET framework provides automatic memory management using a technique called ?
Correct Answer
B. Garbage Collection
Explanation
The correct answer is Garbage Collection. The .NET framework uses garbage collection to automatically manage memory. Garbage collection is a technique where the framework automatically identifies and removes objects that are no longer being used, freeing up memory space. This helps prevent memory leaks and improves the overall performance and efficiency of the application.
9.
What is the base class from which all Web forms inherit?
Correct Answer
B. Page Class
Explanation
The correct answer is Page Class. The Page class is the base class from which all Web forms inherit in ASP.NET. It provides the basic functionality and properties required for creating and managing web pages. This class includes methods and properties for handling events, managing state, and interacting with the user interface. By inheriting from the Page class, developers can build custom web forms and take advantage of the built-in features and functionality provided by ASP.NET.
10.
Which of the following must be done in order to connect data from some data resource to Repeater control?
Correct Answer(s)
A. Set the DataSource property
B. Call the DataBind method
Explanation
To connect data from a data resource to a Repeater control, two steps must be done. First, the DataSource property of the Repeater control must be set to the desired data resource. This tells the Repeater control where to retrieve the data from. Second, the DataBind method must be called on the Repeater control. This method binds the data from the data resource to the Repeater control, allowing it to display the data. The other two options, configuring the database to allow repeater access and asking the DB admin to configure a special named pipe, are not necessary for connecting data to a Repeater control.
11.
JQuery is?
Correct Answer
C. A collection of scripts used to enhance End-User clientside experience.
Explanation
jQuery is a collection of scripts used to enhance the end-user client-side experience. It is a fast, small, and feature-rich JavaScript library that simplifies HTML document traversal, event handling, and animation for web development. It allows developers to write less code while achieving more functionality, making it easier to create interactive and dynamic web pages.
12.
The type of code found in Code-Behind class is ?
Correct Answer
A. Server-side
Explanation
The code found in the Code-Behind class is server-side code. Server-side code is executed on the server and is responsible for processing requests, interacting with databases, and generating dynamic content to be sent to the client. This code is not accessible or visible to the client and helps in handling server-side operations, such as data manipulation, business logic, and server communication.
13.
The actual work process of ASP.NET is taken care by ?
Correct Answer
C. Aspnet_wp.exe
Explanation
aspnet_wp.exe is the correct answer because it is responsible for handling the actual work process of ASP.NET. It is an executable file that runs as a worker process for ASP.NET applications. It manages the execution of ASP.NET requests, handles application domain recycling, and provides isolation between multiple ASP.NET applications. inetinfo.exe is the Internet Information Services (IIS) process responsible for handling incoming HTTP requests, while aspnet_isapi.dll is an ISAPI extension that helps IIS communicate with ASP.NET. Therefore, neither of these options is the correct answer.
14.
How many classes can a single .NET DLL contain?
Correct Answer
D. Unlimited
Explanation
A single .NET DLL can contain an unlimited number of classes. This means that there is no restriction on the number of classes that can be included in a DLL file. This allows developers to organize their code into multiple classes within a single DLL, making it easier to manage and reuse code. Additionally, having multiple classes in a DLL allows for better encapsulation and separation of concerns in software development.
15.
Which of the following can be used to add alternating color scheme in a Repeater control?
Correct Answer
C. AlternatingItemTemplate
Explanation
The AlternatingItemTemplate can be used to add an alternating color scheme in a Repeater control. This template allows for the customization of the appearance of alternating items in the Repeater control, such as setting different background colors for each item. By using the AlternatingItemTemplate, developers can easily achieve a visually appealing alternating color scheme in the Repeater control.
16.
Suppose a .NET programmer wants to convert an object into a stream of bytes then the process is called ?
Correct Answer
B. Serialization
Explanation
Serialization is the correct answer because it refers to the process of converting an object into a stream of bytes, which can be stored or transmitted and later reconstructed to create a new object with the same properties. This is commonly used in .NET programming to save and load objects, send data over networks, or store data in databases. Threading, RCW, and AppDomain are unrelated concepts and not relevant to the given question.
17.
The namespace used to program around ActiveDirectory services is called ?
Correct Answer
D. System.DirectoryServices
Explanation
The correct answer is System.DirectoryServices. This namespace is used to program around ActiveDirectory services. It provides classes and methods for interacting with Active Directory, such as querying, creating, modifying, and deleting directory objects.
18.
Which of the following is TRUE about Windows Authentication in ASP.NET?
Correct Answer
A. Automatically determines role membership
Explanation
Windows Authentication in ASP.NET automatically determines role membership. This means that the roles assigned to a user are determined by the authentication mechanism itself, without the need for additional programming by the user. This simplifies the process of managing user roles and allows for easy integration with Windows Active Directory or other authentication providers.
19.
What tags one need to add within the asp:datagrid tags to bind columns manually?
Correct Answer
A. Set AutoGenerateColumns Property to false on the datagrid tag
Explanation
To bind columns manually within the asp:datagrid tags, one needs to set the AutoGenerateColumns property to false on the datagrid tag. This will disable the automatic generation of columns and allow the user to manually define and bind the columns.
20.
How do you explicitly kill a user session?
Correct Answer
B. Session.Abandon
Explanation
Session.Abandon is the correct answer because it is the method used to explicitly kill a user session in many programming languages, including ASP.NET. When Session.Abandon is called, it terminates the session and removes all session data, effectively ending the user's session on the website or application. This is commonly used when a user logs out or when their session needs to be forcefully terminated for security or administrative reasons.
21.
You create 4 forms FormA, FormB, FormC and FormD. You want to allow users to open FormA, FormB and FormC at the same time within FormD. Which properties do you need to set?
Correct Answer
B. MdiParent on Forms A,B and C; and IsMdiContainer on FormD.
22.
You should constrain user input to data you know is safe by:
Correct Answer(s)
A. Setting max length on ASP.NET and HTML input controls
B. Using ASP.NET validation controls (RequiredFieldValidation, CompareValidator, RangeValidator, RegularExpressionValidator, CustomValidator) to constrain user input via ASP.NET input controls as much as possible.
C. Constraining user input to a white list (list of acceptable characters)
Explanation
The correct answer suggests that there are multiple ways to constrain user input to ensure data safety. One way is by setting a maximum length on ASP.NET and HTML input controls, which limits the amount of data that can be entered. Another method is to use ASP.NET validation controls, such as RequiredFieldValidation, CompareValidator, RangeValidator, RegularExpressionValidator, and CustomValidator, to enforce specific constraints on user input. Additionally, constraining user input to a white list, which is a predefined list of acceptable characters, can help prevent the input of unwanted or malicious data.
23.
Which security process allows a website to confirm you are who you say you are?
Correct Answer
C. Authentication
Explanation
Authentication is the security process that allows a website to confirm the identity of a user. It verifies that the user is who they claim to be by using various methods such as passwords, biometrics, or security tokens. This process ensures that only authorized individuals can access the website and its resources, protecting against unauthorized access and potential security breaches.
24.
If the value of passwordFormat is set to _______, users cannot retrieve their original passwords
Correct Answer
D. Hashed
Explanation
If the value of passwordFormat is set to "Hashed", it means that the passwords are stored in a hashed format. Hashing is a one-way function that converts the password into a fixed-length string of characters, making it extremely difficult to retrieve the original password. Therefore, users cannot retrieve their original passwords as they are securely stored in a non-reversible format.
25.
In a production environment, you should NOT leave debug = ?
Correct Answer
A. True
Explanation
In a production environment, it is not recommended to leave the debug mode enabled. Debug mode is typically used for troubleshooting and development purposes, as it provides more detailed information about errors and the internal workings of the system. However, leaving debug mode enabled in a production environment can pose security risks and impact performance. It may expose sensitive information to potential attackers and also slow down the system due to the additional logging and processing required. Therefore, it is best practice to disable debug mode in a production environment.
26.
When customErrors mode is set to Off, which of the following happens when an error occurs:
Correct Answer
B. All visitors see the full error details
Explanation
When the customErrors mode is set to Off, it means that all visitors, both local and remote users, will see the full error details when an error occurs. This means that instead of being redirected to a custom error page, users will see the complete error message, including the stack trace and other relevant information. This can be useful for debugging purposes, but it also means that sensitive information may be exposed to the users.
27.
When an exception occurs, the remainder of the code in the ____ block is skipped
Correct Answer
A. Try
Explanation
When an exception occurs, the remainder of the code in the try block is skipped. The try block is where the code that might throw an exception is placed. If an exception occurs within the try block, the program jumps to the catch block to handle the exception. Therefore, any code after the point where the exception is thrown will not be executed.
28.
What are the different ways to overload a method?
Correct Answer(s)
B. Different parameter data types
C. Different number of parameters
D. Different ordering of parameters
Explanation
The different ways to overload a method include using different parameter data types, different number of parameters, and different ordering of parameters. This means that you can have multiple methods with the same name but with different parameters, allowing you to perform different operations based on the arguments passed to the method. This provides flexibility and allows for code reuse, as you can create multiple versions of a method that cater to different scenarios or data types.
29.
How do you enforce garbage collection in .NET?
Correct Answer
D. System.GC.Collect()
Explanation
In .NET, the method to enforce garbage collection is System.GC.Collect(). This method is used to explicitly request the .NET garbage collector to perform garbage collection. It is important to note that calling this method does not guarantee immediate garbage collection, as the garbage collector operates on its own schedule. However, it can be used to optimize memory usage by freeing up resources that are no longer needed.
30.
How many machine.config files can be on a system?
Correct Answer
A. 1
Explanation
There can only be one machine.config file on a system. The machine.config file is a configuration file used by the .NET framework to define settings that are applied globally to all applications on the system. Having multiple machine.config files would cause conflicts and inconsistencies in the configuration settings. Therefore, only one machine.config file is allowed to ensure proper functioning of the .NET framework.