ASP INTERVIEW QUESTION TIPS PART 1

The Control class belongs to which namespace?

1. System.Web.UI
2. System.Web.UI.WebControls
3. System.Web
4. System
Correct Answer: -> 1

Feedback: -> That’s correct. The Control class is the base class for all the server controls that are used for building the user interface. It resides in the System.Web.UI namespace, which contains the base classes used to build the user interface of an ASP.NET page.

Which of the following state management options can be used to automatically save the value of each control before rendering the page?

1. The ViewState property
2. Hidden fields
3. Cookies
4. Query strings

Your Answer: -> 1

Feedback: -> That’s correct. Each Web Form page and the controls on the page have the ViewState property that is inherited from the base Control class. The ASP.NET framework uses the ViewState property to automatically save control-specific and page-specific values.

Which class supports page-level tracing in an ASP.NET application?
1. TraceContext
2. Trace
3. HttpHandlerConfigHandler
4. HttpModulesConfigHandler
Your Answer: -> 1
Feedback: -> That’s correct. The TraceContext class supports the trace functionality for ASP.NET pages.

Which attribute of the forms element is used in the Web.Config file to specify the page to which a user request is to be redirected for logon?
1. name
2. loginUrl
3. protection
4. timeout
Correct Answer: -> 2
Feedback: -> That’s correct. The loginUrl attribute of the forms element is used to specify the page to which the user request is to be redirected for logon when no valid authentication cookie is found.

Which of the following objects is used to store and retrieve information that can be shared among all the users of an application?
1. Request
2.. Application
3. Response
4. Server
Correct Answer: -> 2
Feedback: -> That’s correct. The Application object is used to store and retrieve the information that can be shared among all the users of an application. For example, you can use an Application object to create a chat page.

You have created the login.aspx Web Form for accepting the user name and password. To successfully log on, a user must specify “appuser” as the user name and “paradise” as the password. Which of the following statements will you use in the Web.Config file to be able to perform the specified task?


1.







2.







3.





4.






Correct Answer: -> 2

Feedback: -> That’s incorrect. Web.Config is an XML-based file. Therefore, it must conform to the rules for well-formed XML documents. In the code, the tags are not closed properly. Therefore, the code will result in an error.

Which of the following attributes of the trace element is used to specify whether or not trace information will be displayed for each Web Form?
1. enabled
2. requestLimit
3. pageOutput
4. traceMode
Correct Answer: -> 3

Feedback: -> That’s incorrect. The enabled attribute is used to enable the trace feature for an ASP.NET application.


Which of the following is the correct definition of impersonation?

1. Impersonation refers to the process of verifying whether a user has permissions to access an application.
2. Impersonation refers to the process of restricting the access of an authenticated user to parts of the application or Web site for which a user is already authenticated.
3. Impersonation refers to an ASP.NET application using the identity of a client.
4. Impersonation refers to the practice of providing content and other facilities, such as the background color of the Web Form, to users based on their preferences.

Correct Answer: -> 3
Feedback: -> That’s incorrect. Authentication refers to the process of verifying whether a user has permissions to access an application.

Which of the following templates refers to the collection of elements and controls that are rendered once for each row in a data source?

1. SelectedItemTemplate
2. ItemTemplate
3. EditItemTemplate
4. AlternatingItemTemplate

Correct Answer: -> 2
Feedback: -> That’s incorrect. SelectedItemTemplate refers to the collection of elements and controls that are rendered when an item is selected in the server control.