0% found this document useful (0 votes)
13 views6 pages

ASP Question Bank

The document contains a series of questions and answers related to ASP.NET, covering topics such as its definition, programming languages used, file extensions, controls, ViewState, Page Lifecycle events, session state modes, and cookie management. Key points include that ASP.NET stands for Active Server Pages .NET, primarily uses C#, and utilizes .aspx file extensions. It also addresses security risks associated with cookies and the importance of maintaining state information across postbacks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views6 pages

ASP Question Bank

The document contains a series of questions and answers related to ASP.NET, covering topics such as its definition, programming languages used, file extensions, controls, ViewState, Page Lifecycle events, session state modes, and cookie management. Key points include that ASP.NET stands for Active Server Pages .NET, primarily uses C#, and utilizes .aspx file extensions. It also addresses security risks associated with cookies and the importance of maintaining state information across postbacks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

What does ASP.NET stand for?

A) Active Server Pages Network

B) Application Service Provider Network

C) Advanced Software Programming Network

D) Active Server Pages .NET

Answer: D) Active Server Pages .NET

Which programming language is primarily used for ASP.NET development?

A) Java

B) C#

C) Python

D) Ruby

Answer: B) C#

Which file extension is used for ASP.NET web pages?

A) .html

B) .aspx

C) .php

D) .js

Answer: B) .aspx

Which of the following is a valid ASP.NET control?

A) <form>

B) <table>

C) <asp:TextBox>

D) <div>
Answer: C) <asp:TextBox>

What is the purpose of the ViewState in ASP.NET?

A) To store session data

B) To store user credentials

C) To maintain state information across postbacks

D) To manage database connections

Answer: C) To maintain state information across postbacks

Which of the following is not a valid event in the Page Lifecycle of an ASP.NET page?

A) Page_Load

B) Page_Start

C) Page_Init

D) Page_Unload

Answer: B) Page_Start

What is the role of the Global.asax file in an ASP.NET application?

A) It defines global variables.

B) It handles global events and application-level events.

C) It contains CSS styles for the entire application.

D) It manages database connections.

Answer: B) It handles global events and application-level events.

Which of the following is not a valid session state mode in ASP.NET?

A) InProc

B) SQLServer

C) Stateful
D) StateServer

Answer: C) Stateful

What is the purpose of the Response.Redirect() method in ASP.NET?

A) To send a request to another website

B) To redirect the user to another web page within the same application

C) To refresh the current page

D) To close the current browser window

Answer: B) To redirect the user to another web page within the same application

Which of the following is not a valid ASP.NET authentication mode?

A) Forms

B) Windows

C) Passport

D) Basic

Answer: C) Passport
What is a cookie in ASP.NET?

A) A server-side control for user authentication

B) A temporary storage mechanism for session data

C) A small piece of data stored on the client-side

D) A file uploaded by users to the server

Answer: C) A small piece of data stored on the client-side

Which namespace is used to work with cookies in ASP.NET?

A) System.Web.Security

B) System.Web.UI

C) System.Net

D) System.Web.HttpCookie

Answer: D) System.Web.HttpCookie

What is the maximum size of a single cookie that can be stored on the client-side in ASP.NET?

A) 1 KB

B) 2 KB

C) 4 KB

D) 8 KB

Answer: C) 4 KB

Which property of the HttpCookie class is used to set the expiration time of a cookie?

A) Expires

B) MaxAge

C) Duration

D) Timeout
Answer: A) Expires

What is the default scope of a cookie in ASP.NET?

A) Application

B) Session

C) Page

D) Request

Answer: D) Request

Which of the following is not a valid way to delete a cookie in ASP.NET?

A) Setting the cookie's expiration date to a past date

B) Using the HttpCookie.Delete() method

C) Removing the cookie from the Cookies collection

D) Using the Response.Cookies.Clear() method

Answer: B) Using the HttpCookie.Delete() method

What is the purpose of the HttpCookie.Secure property in ASP.NET?

A) To specify whether the cookie is accessible only over HTTPS

B) To encrypt the cookie data

C) To specify the expiration time of the cookie

D) To specify the domain for which the cookie is valid

Answer: A) To specify whether the cookie is accessible only over HTTPS

Which event handler is typically used to read cookies when a page is requested in ASP.NET?

A) Page_Init

B) Page_Load

C) Page_PreRender
D) Page_Unload

Answer: B) Page_Load

What happens if a client disables cookies in their browser?

A) ASP.NET will throw an exception

B) The server will store session data on the client's machine

C) ASP.NET will automatically switch to URL rewriting

D) ASP.NET will not be able to maintain state between requests

Answer: D) ASP.NET will not be able to maintain state between requests

Which of the following is a potential security risk associated with cookies in ASP.NET?

A) Cross-Site Scripting (XSS) attacks

B) Denial of Service (DoS) attacks

C) SQL Injection attacks

D) Man-in-the-Middle (MITM) attacks

Answer: A) Cross-Site Scripting (XSS) attacks

You might also like