Olete.in
Articles
Mock Tests
🧪 ASP.Net MCQ Quiz Hub
ASP.Net Mcq Question Set 1
Choose a topic to test your knowledge and improve your ASP.Net skills
1. What is the name of the Page object’s property that determines if a Web page is being requested without data being submitted to server?
IsCallback
IsReusable
IsValid
IsPostBack
2. ______ is the DataType return in IsPostback property.
bit
boolean
int
Object
3. When does Garbage collector run?
When application is running low of memory
It runs random
When application is running for more than 15 minutes
none of the above
4. Which is the first event of ASP.NET page, when user requests a web page?
PreLoad
Load
Preinit
Init
5. What happens in the Init event of a page?
ViewState is loaded on the page.
Each child control of the page is initialized to its design time values.
HTML is rendered.
None of the above.
6. Which one of the following has a parameter called as “preserveForm”?
Server.transfer
Response.redirect
all of the above
none of the above
7. Which validation control in ASP.NET can be used to determine if data that is entered into a TextBox control is of type Currency?
ValidationSummary
CompareValidator
RequiredFieldValidator
None of the above.
8. If we want to add graphics using asp.net which of the following web control will you use?
Link Button
AdRotator
Grid View
Layout
9. What is/are true about master page? Choose the correct option.
You can add more than one master page in a website.
Master page can be nested.
ContentPlaceHolder control is required on a content page.
Both A and B option are correct.
10. Which of the following statements about referencing master page methods and properties is true?
Content pages can reference controls in the master page.
Content pages can reference public properties in the master page.
Content pages can reference public methods in the master page
All of the above.
11. How many types of authentication ASP.NET supports?
Windows Authentication.
.NET Passport Authentication.
Forms Authentication.
All of the above.
12. Which of the following is the default authentication mode for IIS?
Anonymous
Windows
Basic Authentication
None of the mentioned
13. You use the ASP.NET Web Site Administration Tool to configure ASP.NET membership with forms authentication. What should you name your login form so that you do not have to modify the Web.config file?
Login.aspx
LoginPage.aspx
Default.aspx
Auth.aspx
14. What are the types of cookies?
Session cookies
Persistent cookies.
Dummy cookies.
Option A and B are correct.
15. Default Session data is stored in ASP.Net.
StateServer
Session Object
InProcess
All of the above
16. Which session modes stores session Information in Current Application Domain?
InProc
StateServer
SQLServer
Off
17. Choose the correct option about the Integrated Security property of connection object.
If Integrated Security=false then User ID, and Password must be specified in the connection string.
If Integrated Security=true then current Windows account credentials are used for authentication.
Both A and B option are correct.
None of the above.
18. In which file you should write the connection string, so you can access it in all the web page for same application?
In App_Data folder.
In Web.config file.
In MasterPage file.
None of the above.
19. How will you specifying the Cache Location?
You can use browser settings to specify where a page is cached.
You can use the Location attribute of the < %@ OutputCache %> directive to specify where a page is cached.
You can use the Location attribute in QueryString to specify where a page is cached.
None of the above.
20. Which of these data source controls do not implement Caching?
LinqDataSource
ObjectDataSource
SqlDataSource
XmlDataSource
21. You want to make a configuration setting change that will affect only the current Web application. Which file will you change?
Global.asax
Web.config in the root of the Web application
Machine.config
All of the above
22. ____is the first method that is fired during the page load.
PreRender()
Load()
Unload()
Init()
23. What is a web application running on multiple servers called?
HTTP
Web Servers
Web Page
Web farm
24. What property do you modify on a server control to minimize the size of the ViewState data?
ViewState=”true”
Set EnableViewState to false.
Set EnableViewState to true.
None of the above
25. A web page has lots of input data, and you want the data input to be spread across multiple screens. What is the best control to use to implement this solution on a single Web page?
ImageMap
Panel
Wizard
none of the above
26. ASP.NET validation controls works (handle validation) at
Client side only.
Server side only.
Both client side and server side.
None of the above.
27. There is a button on page name cancel and it should bypass validation when cancel button is clicked. What will you do?
set CausesValidation = false.
set RemoveValidation=true
set cancel=true
None of the above.
28. Which of the following is a valid skin code inside a skin file?
< asp:TextBox BackColor=”Yellow” BorderStyle=”Dotted” ID=”colorTxt” Runat=”Server”/>
< asp:TextBox BackColor=”Yellow” BorderStyle=”Dotted” Runat=”Server” />
< asp:TextBox BackColor=”Yellow” BorderStyle=”Dotted” ID=”colorTxt” />
None of the above.
29. What is/are the advantages of master page?
It helps to display common content in multiple pages.
They allow you to centralize the common functionality of your pages so that you can make updates in just one place.
It helps to create a common page layout.
All of the above.
30. How to implement authentication via web.config?
Include the authentication element.
Include the authorization element.
Include the identity element.
Include the deny element.
31. Windows-Based Authentication is well suited for.
Intranet environment.
Public web site.
Desktop application.
None of the above.
32. If any user has disabled cookies in their browsers, what can you do to enable them to use forms authentication?
Set BoweserCookieEnabled=true;
Set cookieless=true;
Use the AutoDetect setting of the cookieless attribute.
None of the above.
33. What ASP.NET object encapsulates the state of the client and the browser?
Application Object
Session Object
Response Object
Request Object
34. In ASP.NET what are the different types of session mode available?
InProc
StateServer
SQLServer
All of the above
35. To kill a users session explicitly which of the following will you use?
Session.Close()
Session.End()
Session.Abondon()
Session.Discard()
36. Which control is required of every AJAX page to manage the JavaScript files sent to the client and the communication between client and server?
UpdatePanel
ScriptManager
AsyncPostBackTrigger
None of the above.
37. What property and method of the Page object do you use to register client script dynamically from code?
ScriptManager control is used to dynamically register client script from code.
The Page.ClientScript.RegisterClientScriptBlock is used to dynamically register client script from code.
ScriptManagerProxy control is used to dynamically register client script from code.
None of the above.
38. Which ado.net class provide disconnected environment?
DataReader
DataSet
Command
None of the above.
39. What data type is returned when calling the ExecuteScalar method of a command object?
System.Int32
Object
No of effected records.
None of the above.
40. How many types of Cache Dependencies are available in ASP.NET?
File based dependencies
Key-based dependencies
Time-based dependencies
All of the above
41. In order to prevent a browser from caching a page which of these xstatements should be written?
Response.Cache.SetNoStore();
Response.Cache.SetNoServerCaching();
Response.Cache.SetNoCaching();
None of these
42. You need to programmatically configure page output caching. Which object would you use?
Request
Response
Application
server address
43. What are the Command Object Methods?
ExecuteNonQuery
ExecuteReader
ExecuteScalar
All of the above.
44. To perform asynchronous data access, what must be added to the connection string?
BeginExecute=true
MultiThreaded=true
MultipleActiveResultSets=true
Asynchronous=true
45. A Master Page contains a ScriptManager control and a user wants the AJAX functionality on content page then which control is necessary on content page.
AsyncPostBackTrigger
ScriptManager
ScriptManagerProxy
None of the above.
46. Which of the following is not a member of ADODBCommand object?
ExecuteScalar
ExecuteStream
Open
ExecuteReader
47. From the following which is not a valid state management object?
Querystate
Cookies
Application state
Hidden form fields
48. Where do we include the user lists for Form authentication?
< credential>
< authorization>
< Identity>
< authentication>
49. By default, a .Net web site is configured with which of the following authentication types?
Anonymous
Basic
Integrated Windows authentication
a and c
50. Validation events of server controls occur before the page is post back to the server.
True
False
all of the above
None of the mentioned
Submit