ASP.NET - Set 5

1)   If a user wants to create controls at runtime which event should be used to write code?

a. PreLoad
b. Load
c. Init
d. PreInit
Answer  Explanation 

ANSWER: PreInit

Explanation:
No explanation is available for this question!


2)   How will you add a TextBox control at runtime on the form? Choose the correct one.

a. TextBox obj = new TextBox();
    obj.ID = "txtUserName";
    form1.Controls.Add(obj);
b. form1.Controls.Add(TextBox);
c. this.FindControl.add(TextBox);
d. None of the above.
Answer  Explanation 

ANSWER: TextBox obj = new TextBox();
    obj.ID = "txtUserName";
    form1.Controls.Add(obj);

Explanation:
No explanation is available for this question!


3)   You are creating an ASP.NET application for company CareerRide. You use form based authentication to validate users. You need to prevent unauthenticated users from accessing the application. What should you do?


a. In the authorization section of the Web.config file, set the users attribute of the deny element to “?”
b. Set In the authorization section of the Web.config file, set the users attribute of the deny element to “*”
c. In the authorization section of the Machine.config file, set the users attribute to the allow element to “?”.
d. None of the above.
Answer  Explanation 

ANSWER: In the authorization section of the Web.config file, set the users attribute of the deny element to “?”

Explanation:
No explanation is available for this question!


4)   If any user has disabled cookies in their browsers, what can you do to enable them to use forms authentication?

a. Set BoweserCookieEnabled=true;
b. Set cookieless=true;
c. Use the AutoDetect setting of the cookieless attribute.
d. None of the above.
Answer  Explanation 

ANSWER: Use the AutoDetect setting of the cookieless attribute.

Explanation:
No explanation is available for this question!


5)   What is the use of VaryByParam attribute in OutputCache directive?

a. You can neglect VaryByParam attribute while using Page output caching.
b. The VaryByParam attribute determines which versions of the page output are actually cached.
c. The VaryByParam attribute determines which web page is cached in database.
d. None of the above.
Answer  Explanation 

ANSWER: The VaryByParam attribute determines which versions of the page output are actually cached.

Explanation:
No explanation is available for this question!


6)   You need to programmatically configure page output caching. Which object would you use?

a. Request
b. Response
c. Application
d. Server
Answer  Explanation 

ANSWER: Response

Explanation:
No explanation is available for this question!


7)   Which control is required inside a content page to reference ContentPlaceHolder control inside the master page?

a. Content control on a content page.
b. ContentPlaceHolder on a content page.
c. PlaceHolder control is required on content page.
d. None of the above.
Answer  Explanation 

ANSWER: Content control on a content page.

Explanation:
No explanation is available for this question!


8)   At which level Theme can be applied?

a. Page level
b. Site level (through the Web.config file)
c. Individual control level
d. All of the above.
Answer  Explanation 

ANSWER: All of the above.

Explanation:
No explanation is available for this question!


9)   When user request a web page by entering Uniform Resource Locator (URL) then which method /verb/command is used in ASP.NET?

a. POST
b. SET
c. GET
d. All of the above.
Answer  Explanation 

ANSWER: GET

Explanation:
No explanation is available for this question!


10)   HTTP messages are typically sent between the Web server and Web browser using which Port number?

a. 70
b. 80
c. 400
d. 410
Answer  Explanation 

ANSWER: 80

Explanation:
No explanation is available for this question!


11)   What type of data can Cookies store?

a. String
b. DateTime
c. System.Int32
d. None of the above.
Answer  Explanation 

ANSWER: String

Explanation:
No explanation is available for this question!


12)   What are the different types of Session Mode in ASP.NET?

a. InProc
b. StateServer
c. SQLServer
d. All of the above
Answer  Explanation 

ANSWER: All of the above

Explanation:
No explanation is available for this question!


13)   Which validation control in ASP.NET can be used to determine if the data is entered into a TextBox control is of type Currency?

a. ValidationSummary
b. CompareValidator
c. RequiredFieldValidator
d. None of the above.
Answer  Explanation 

ANSWER: CompareValidator

Explanation:
No explanation is available for this question!


14)   CompareValidator control can be used for performing which task?

a. To perform a data type check.
b. To compare the value entered into a form field against a fixed value.
c. To compare the value of one form field against another.
d. All of the above.
Answer  Explanation 

ANSWER: All of the above.

Explanation:
No explanation is available for this question!


15)   Match the following List 1 to List 2

a. Client-side navigation ---------------------- i. Server.Transfer
b. Cross-page posting ------------------------- ii. Response.Redirect
c. Client-side browser redirects ------------- iii. PostBackUrl
d. Server-side transfer ------------------------- iv. HyperLink


a. a-iv, b-iii, c-ii, d-i
b. a-ii, b-iv, c-i, d-iii
c. a-ii, b-i, c-iii, d-iv
d. a-ii, b-iv, c-iii, d-i
Answer  Explanation 

ANSWER: a-iv, b-iii, c-ii, d-i

Explanation:
No explanation is available for this question!


16)   You want to enable Page Output Caching in ASP.NET. What code you will write in ASPX page.


a. <%@ OutputCache Duration="30" VaryByParam="none" %>
b. <%@ OutputCache VaryByParam="none" %>
c. <%@ OutputCache Duration="30" %>
d. None of the above.
Answer  Explanation 

ANSWER: <%@ OutputCache Duration="30" VaryByParam="none" %>

Explanation:
No explanation is available for this question!


17)   How many types of Cache Dependencies are available in ASP.NET?

a. File based dependencies
b. Key-based dependencies
c. Time-based dependencies
d. All of the above
Answer  Explanation 

ANSWER: All of the above

Explanation:
No explanation is available for this question!


18)   Choose the correct option according to given statements.

Statement 1: Authentication is the process that determines the identity of a user.
Statement 2: Authorization is the process of determining whether a user is permitted to access to any part of an application, or any particular resource.
Statement 3: Authorization is the process that determines the identity of a user.
Statement 4: Authentication is the process of determining whether a user is permitted access to any part of an application, or any particular resource.


a. Statement 1 and Statement 2 are correct.
b. Statement 3 and Statement 4 are correct.
c. Statement 1 and Statement 3 are correct.
d. Statement 2 and Statement 4 are correct.
Answer  Explanation 

ANSWER: Statement 1 and Statement 2 are correct.

Explanation:
No explanation is available for this question!


19)   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?

a. Login.aspx
b. LoginPage.aspx
c. Default.aspx
d. Auth.aspx
Answer  Explanation 

ANSWER: Login.aspx

Explanation:
No explanation is available for this question!


20)   What are the three main objects of DataSet?

a. DataTable, DataColumn, and type.
b. DataTable, DataRelation, and DataAdapter.
c. DataTable, DataColumn, and DataRelation.
d. DataReader,DataAdapter, and Command.
Answer  Explanation 

ANSWER: DataTable, DataColumn, and DataRelation.

Explanation:
No explanation is available for this question!


21)   On what object would you set the properties to create a primary key for a DataTable?

a. DataRelation
b. DataColumn
c. DataSet
d. DataTable
Answer  Explanation 

ANSWER: DataSet

Explanation:
No explanation is available for this question!


22)   How many 'ScriptManager' control can be added on a ASP.NET web page?

a. Only One
b. More than One
c. Only Two
d. None of the above.
Answer  Explanation 

ANSWER: Only One

Explanation:
No explanation is available for this question!


23)   Which property and method of the Page object do you use to register client script dynamically from code?

a. ScriptManager control is used to dynamically register client script from code.
b. The Page.ClientScript.RegisterClientScriptBlock is used to dynamically register client script from code.
c. ScriptManagerProxy control is used to dynamically register client script from code.
d. None of the above.
Answer  Explanation 

ANSWER: The Page.ClientScript.RegisterClientScriptBlock is used to dynamically register client script from code.

Explanation:
No explanation is available for this question!


24)   Match the following List 1 to List 2

a. Web Form -------------------------- i. .ascx
b. Web User Control ---------------- ii. .asmx
c. Web Service ---------------------- iii. .aspx


a. a-iii, b-i, c-ii
b. a-ii , b-i, c-iii
c. a-i, b-ii, c-iii

Answer  Explanation 

ANSWER: a-iii, b-i, c-ii

Explanation:
No explanation is available for this question!


25)   To create your application on a remote server which option you will choose in ASP.NET?

a. File System
b. FTP
c. HTTPS
d. None of the above.
Answer  Explanation 

ANSWER: FTP

Explanation:
No explanation is available for this question!