ASP.NET

Description: Test your skills in ASP.Net
Number of Questions: 25
Created by:
Tags: ASP ASP.Net Web Development Web Site BBA / BBS / BCA Information Technology
Attempted 0/25 Correct 0 Score 0

Which of the following is NOT a valid file extension in ASP.NET?

  1. .asax

  2. .ascx

  3. .axd

  4. .asmx

  5. .asfx


Correct Option: E
Explanation:

There is no file with the .asfx extension in ASP.NET.

Which of the following controls is used to ensure that an input value matches a specified pattern?

  1. RegularExpressionValidator

  2. RegularPatternValidator

  3. CompareValidator

  4. CustomValidator

  5. RequiredFieldValidator


Correct Option: A
Explanation:

RegularExpressionValidator control in ASP.NET is used to check the user input based on a pattern that we define using RegularExpression. If the value does not match with the RegularExpression, then an error message is displayed.

Which of the following methods of the Global.asax file is called when the first resource is requested from the web server?

  1. Session_Start()

  2. Application_BeginRequest()

  3. Application_Start()

  4. Application_AuthenticateRequest()

  5. Application_AcquireRequestState()


Correct Option: C
Explanation:

Application_Start() is fired when the first resource is requested from the web server and the web application starts. It allows us to create objects that accessible by all HttpApplication instances.

Which of the following page life cycle events is raised after the page loads view state for itself and all other controls, and then it processes postback data?

  1. init

  2. PreLoad

  3. PreRender

  4. InitComplete

  5. LoadComplete


Correct Option: B
Explanation:

The PreLoad event is raised after the page loads view state for itself and all controls, and after it processes PostBack data that is included with the Request instance. We can process any kind of operation that we want before the page load.

Which of the following statements is FALSE regarding cookies?

  1. Size of cookies is limited to 4096 bytes.

  2. Most browsers allow only 20 cookies per site.

  3. The Operating System is responsible for managing cookies on a user system.

  4. The cookie contains the information that the Web application can read whenever the user visits the site.

  5. The end user can stop accepting cookies by changing browser setting.


Correct Option: C
Explanation:

The browser is responsible for managing cookies on a user system. Cookies are sent to the browser via the HttpResponse object that exposes a collection called Cookies.

Which of the following is NOT a valid directive in ASP.NET?

  1. @Implements

  2. @OutputCache

  3. @Register

  4. @MasterPage

  5. @Import


Correct Option: D
Explanation:

This is not a valid directive for an ASP.NET page.

Which ASP.NET folder is used to store files such as .mdf, .mdb and XML?

  1. Bin

  2. App_Code

  3. App_Data

  4. App_Database

  5. App_Browser


Correct Option: C
Explanation:

The App_Data folder is used as a data storage for the web application. It can store files such as .mdf, .mdb and XML. It manages all of our application's data centrally. It is accessible from anywhere in your web application.

Which of the following is NOT an ASP.NET object?

  1. Application

  2. Request

  3. Cookie

  4. Response

  5. Session


Correct Option: C
Explanation:

A cookie is not an object but a small file that the server embeds on the user's computer. Whenever the same computer requests a page with a browser, it will send the cookie too.

Which web server control allows us to place an empty container control in the page and then dynamically add child elements to it at run time?

  1. Panel

  2. Table

  3. Image

  4. PlaceHolder

  5. ListBox


Correct Option: D
Explanation:

The PlaceHolder Web server control allows us to place an empty container control within the page and then dynamically add, remove or loop through child elements at run time. The control renders only its child elements, it renders no markup of its own. In other words, the PlaceHolder control does not produce any visible output.

Which of the following is NOT a template in a Repeater Control?

  1. AlternatingItemTemplate

  2. PageTemplate

  3. HeaderTemplate

  4. ItemTemplate

  5. SeparatorTemplate


Correct Option: B
Explanation:

The PageTemplate is invalid template in Repeater Control.

Which of the following objects acts as a mediator between the DataSet object and the database?

  1. DataAdapter Object

  2. DataReader Object

  3. DbConnection

  4. DbCommand

  5. DataTable


Correct Option: A
Explanation:

The DataAdapter object acts as a mediator between the DataSet object and the database. This helps the data set to contain data from more than one databases or other data source. It must be provided with a set of data commands and a database connection used to fill the DataSet and update a database.

Which of the following allows the state of objects to be stored transported back to server whenever required?

  1. ViewState

  2. MasterPage

  3. Global Assembly Cache

  4. Code Access Security

  5. Reflection


Correct Option: A
Explanation:

ViewState is a .NET mechanism to store the posted data among postbacks. ViewState allows the state of objects to be stored in a hidden field on the page, saved on client side and transported back to server whenever required.

How many types of Authentication are there in ASP.NET?

  1. 3

  2. 4

  3. 2

  4. 5

  5. 1


Correct Option: A
Explanation:

Authentication is the process of getting credential from the user and validating them. There are 3 types of Authentication: Windows, Forms and Passport Authentication.

Which of the following is NOT a property of a user control?

  1. They have a .ascx extension.

  2. They are compiled into a dynamic link library (DLL).

  3. They are derived from the System.Web.UI.UserControl class.

  4. The user control cannot have html or body tags.

  5. They have a Control directive instead of a Page directive.


Correct Option: B
Explanation:

A user control is compiled at run time. When the compiler finds the register directive in a .aspx page that points to a user control, it compiles the control before it inserts its content into the .aspx page. The customer controls are compiled as DLL files.

Which of the following is NOT a valid property of an advertisement file with reference to AdRotator control?

  1. Impression

  2. ImageUrl

  3. UrlNavigate

  4. Keyword

  5. AlternateText


Correct Option: C
Explanation:

This is an invalid property. The correct name of the property is NavigateUrl, which is used to point to the URL where the control will be transferred if the user clicks an advertisement.

Which of the following is NOT a property of the POST method?

  1. Post is safer then Get method.

  2. Post requests are not stored in browser's history.

  3. Post requests cannot be bookmarked.

  4. Post request have no restriction on data length.

  5. Post exposes the data in the URL.


Correct Option: E
Explanation:

The data is not visible in the URL. The Get method displays the data in the QueryString. This makes Post a safer choice than the Get method.

Which namespace would be used to create an ASP.NET application with Microsoft SQL Server as the database?

  1. System.Data.Common

  2. System.Data.SQLServer

  3. System.Data.SQLClient

  4. System.Data.OleDb

  5. System.Data.ADO


Correct Option: C
Explanation:

The System.Data.SqlClient namespace is the.NET Framework Data Provider for SQL Server. It describes a collection of classes used to access a SQL Server database in the managed space.

Which of the following statements is FALSE with reference to ASP.NET configuration system?

  1. Configuration information is stored in XML-based text files.

  2. It is extensible.

  3. A web application can have only one web.config file.

  4. The user cannot access a web.config file directly.

  5. Changes in the configuration files are updated automatically.


Correct Option: C
Explanation:

There can be multiple web.config file in multiple directories on an ASP.NET Web application server. Each Web.config file applies configuration settings to its own directory and all child directories.

Which method of the Session Object is used to destroy a user session?

  1. TimeOut

  2. Destroy

  3. Abandon

  4. Remove

  5. Session.Contents.Remove


Correct Option: C
Explanation:

The Abandon method destroys all the objects stored in a Session object and releases their resources. If you do not call the Abandon method explicitly, the server destroys these objects when the session times out.

What can be defined as - manages the execution of programs written in any of several supported languages, allowing them to share common object-oriented classes written in any of the languages?

  1. MSIL

  2. CLR

  3. JIT

  4. DLL

  5. CTS


Correct Option: B
Explanation:

As a part of Microsoft's .NET Framework, the Common Language Runtime (CLR) is programming that manages the execution of programs written in any of the several supported languages, allowing them to share common object-oriented classes written in any of the languages. A program compiled for the CLR does not need a language-specific execution environment and can easily be moved to and run on any system with Windows 2000 or Windows XP .

Which is the preferred protocol to call a web service?

  1. HTTP

  2. SMTP

  3. FTP

  4. SOAP

  5. WSDL


Correct Option: D
Explanation:

SOAP is an XML-based messaging framework specifically designed for exchanging formatted data across the internet. For example, using request and reply messages or sending entire documents. It is the best method for accessing a web service.

Which of the following is a valid pair of wild card characters in web.config?

    • and /
  1. / and ?

    • and ?
  2. ? and _ (underscore)

    • and _(underscore)

Correct Option: C
Explanation:

The users attribute in web.config allows two wild card characters: * and ?. Anonymous users are identified using a question mark (?). We can specify all authenticated users using an asterisk (*).

Which namespace contains classes that define culture-related information?

  1. System.Dynamic

  2. System.IdentityModel

  3. System.Globalization

  4. System.EnterpriseServices

  5. System.Media


Correct Option: C
Explanation:

The System.Globalization namespace contains classes that define culture-related information, including language, country/region, calendars in use, format patterns for dates, currency and numbers, and sort order for strings.

Which data control is used to display one record at a time?

  1. DetailsView

  2. GridView

  3. Repeater

  4. DataList

  5. ListBox


Correct Option: A
Explanation:

The DetailsView control gives you the ability to display, edit, insert or delete a single record at a time from its associated data source. The DetailsView control displays only a single data record at a time.

Which of the following statements about MVC is FALSE?

  1. It separates the modelling of the domain into three separate classes.

  2. It is a design pattern for the separation of user interface logic from business logic.

  3. It increases the complexity of the solution.

  4. The controller part is responsible for displaying all or a portion of the data to the user.

  5. The MVC separation also simplifies group development.


Correct Option: D
Explanation:

Model View Controller or MVC as it is popularly called, is a software design pattern for developing web applications. A Model View Controller pattern is made up of the following three parts: Model - The lowest level of the pattern which is responsible for maintaining the data. View - This is responsible for displaying all or a portion of the data to the user. Controller - Software Code that controls the interactions between the Model and View.

- Hide questions