ASP INTERVIEW QUESTION TIPS PART 2

Which of the following elements in the Web.Config file allows you to specify the custom settings for a Web application?

1. configSections
2. appSettings
3. customErrors
4. trace

Correct Answer: -> 2
Feedback: -> That’s correct. The appSettings element of the Web.config file is used to define the custom settings for a Web application. For example, you can use the appSettings element to store the connection string in the database that you need to access in the various Web Forms of a Web application.

Which of the following statements about a cookie is true?
1. A cookie is a server-side state management option.
2. A cookie is stored on a Web server.
3. A cookie can be either temporary or persistent.
4. A cookie contains application-specific information.

Correct Answer: -> 3

Feedback: -> That’s correct. A cookie can be either temporary or persistent. A temporary cookie, also known as a session cookie, exists in the memory space of a browser. When the browser is closed, all the session cookies added to the browser are lost. A persistent cookie is saved as a text file in the file system of the client computer.

Which of the following types of deployment projects will you use to deploy an ASP.NET application?

1. A setup project
2. A Web setup project
3. A merge module project.
4. A cab project

Correct Answer: -> 2

Feedback: -> That’s correct. A Web setup project is used to package a Web-based application and create a Windows Installer (.msi) file.

The armed forces of a small nation want to develop an Intranet site to manage the stock of arsenal in their stores as well as at forward positions. The armed forces are concerned about espionage and sabotage. Therefore, security is a very important aspect of the application. In the given scenario, which authentication scheme will be the most appropriate?

1. Basic authentication
2. Integrated Windows authentication
3. Anonymous authentication
4. Passport authentication

Correct Answer: -> 2
Feedback: -> That’s incorrect. As per the scenario, the armed forces are concerned about espionage and sabotage. However, in basic authentication, the password of a user is transmitted over a network in an unencrypted form. This makes the password vulnerable to security breaches. Therefore, basic authentication cannot be used in the given scenario.

How can you bind the value entered in the TextBox control txtCity to the Label control Label1?
1. By setting the DataSource property of the Label1 control to txtCity
2. By setting the DataMember property of the Label1 control to txtCity
3. By setting the Text property of the Label1 control to txtCity.Text
4. By using the DataBindings property of the Label1 control and setting the custom binding _expression to txtCity.Text

Correct Answer: -> 4
Feedback: -> That’s correct. To specify the data binding _expression for the Label1 control, you need to click the DataBindings property to open the Label1 DataBindings dialog box. Then, you need to click the Custom binding _expression radio button and specify the data binding _expression in the text box.

You have created a DataList control and added a Button control to it. You have not set the CommandName property of the Button control. Which of the following events will be generated when a user clicks the Button control?
1. EditCommand
2. UpdateCommand
3. ItemCommand
4. CancelCommand

Correct Answer: -> 3

Feedback: -> That’s correct. The ItemCommand event is generated when you click a Button control with no predefined CommandName.

Which file contains the scripts that define the start and end events of an ASP.NET application and its sessions?
1. AssemblyInfo.cs
2. Global.asax
3. Web.Config
4. WebApplication.vsdisco
Correct Answer: -> 2
Feedback: -> That’s incorrect. The Web.Config file is an XML file that contains configuration data on each unique URL resource used in an ASP.NET Web project.

You have created the errors.html file to display error messages for your ASP.NET application. You want to redirect a client browser to the errors.html file whenever an error occurs in the ASP.NET application. How can this be achieved?
1. By setting the defaultRedirect attribute of the customErrors element to “errors.html”
2. By setting the mode attribute of the customErrors element to “errors.html”
3. By setting the defaultRedirect attribute of the appSettings element to “errors.html”
4. By setting the redirect attribute of the customErrors element to “errors.html”

Correct Answer: -> 1
Feedback: -> That’s correct. The defaultRedirect attribute of the customErrors element is used to specify the URL to which the client browser should be redirected when an error occurs.

Which of the following statements will you use in the Web.Config file to specify that an ASP.NET application should use one of the IIS authentication schemes?

1.
2.
3.
4.
Correct Answer: -> 1

Feedback: -> That’s correct. The Windows authentication mode allows you to specify that ASP.NET application should use one of the IIS authentication schemes.

Which of the following statements about the ViewState property is true?
1. The ViewState property is a server-side state management option.
2. By default, the ViewState property of both Web pages and the controls on the Web pages is disabled.
3. Each Web Form page and the controls on the page have the ViewState property that is inherited from the base Control class.
4. The ViewState property should be enabled when you have a large volume of information to maintain.
Correct Answer: -> 3

Feedback: -> That’s incorrect. The ViewState property is a client-side state management option.

Which control allows you to display banner advertisements on an ASP.NET Web Form?
1. A DataGrid control
2. A Repeater control
3. An XML Web server control
4. An AdRotator control
Correct Answer: -> 4

Feedback: -> That’s correct. An AdRotator control allows you to display banner advertisements on an ASP.NET Web Form.

Which of the following classes provides forward-only access to a stream of XML data and checks whether or not an XML document is well-formed?

1. XmlDocument
2. XmlTextReader
3. XmlTextWriter
4. XPathDocument
Correct Answer: -> 2

Feedback: -> That’s correct. The XmlTextReader class provides forward-only access to a stream of XML data and checks whether or not an XML document is well-formed.

The XML Web server control belongs to which namespace?

1. System.Xml
2. System.Xml.Xsl
3. System.Web.UI.WebControls
4. System.Web.UI

Correct Answer: -> 3
Feedback: -> That’s incorrect. The System.Xml namespace provides a rich set of classes for processing XML data.

Which event is generated when a control triggers the reloading of an ASP.NET Web page?
1. Init
2. Load
3. Control
4. Unload

Correct Answer: -> 3

Feedback: -> That’s incorrect. The Load event is generated when an ASP.NET Web page is loaded into memory.

Which of the following state management options can be used to submit information to another page by using a URL?
1. The Viewstate property
2. Hidden fields
3. Cookies
4. Query strings

Correct Answer: -> 4

Feedback: -> That’s correct. Query strings are used if you need to submit information another page by using a URL