ASP.NET - Set 8

1)   Clicking a CheckBox does not cause an automatic PostBack. How do you make the CheckBox cause an automatic PostBack?

a. Set the AutoPostBack property to true.
b. Add JavaScript code to call the ForcePostBack method.
c. Set the PostBackAll property of the Web Page to true.
d. None of the above
Answer  Explanation 

ANSWER: Set the AutoPostBack property to true.

Explanation:
No explanation is available for this question!


2)   What happen in the Web Page when Init event occur?

a. ViewState is loaded on the page.
b. Each child control of the page is initialized to its design time values.
c. HTML is rendered.
d. None of the above
Answer  Explanation 

ANSWER: Each child control of the page is initialized to its design time values.

Explanation:
No explanation is available for this question!


3)   What are the Command Object Methods?

a. ExecuteNonQuery
b. ExecuteReader
c. ExecuteScalar
d. All of the above
Answer  Explanation 

ANSWER: All of the above

Explanation:
No explanation is available for this question!


4)   If you want that command object should returns XML data then which method of Command Object will be used?

a. getXMLData
b. getXML
c. ExecuteXMLReader
d. None of the above.
Answer  Explanation 

ANSWER: ExecuteXMLReader

Explanation:
No explanation is available for this question!


5)    Match the following List 1 to List 2:
       
a. UpdatePanel ------------------ i. If Master Page contains a ScriptManager then content page will use this control.
b. UpdateProgress -------------- ii. ContentTemplate
c. Timer -------------------------- iii. ProgressTemplate
d. ScriptManagerProxy -------- iv. Tick Event


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

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

Explanation:
No explanation is available for this question!


6)   Windows-Based Authentication is well suited for ___________ .

a. Intranet environment
b. Public web site
c. Desktop application
d. None of the above
Answer  Explanation 

ANSWER: Intranet environment

Explanation:
No explanation is available for this question!


7)   What are the minimum attribute is required to create a connection string using SqlConnection object?

a. - Data Source
 - Initial Catalog
 - Integrated security=true
b. - Server
 - Database
 - Integrated security=true
c. Option A and B both are correct
d. None of the above
Answer  Explanation 

ANSWER: Option A and B both are correct

Explanation:
No explanation is available for this question!


8)   What datatype is returned when calling the ExecuteScalar method of a command object?

a. System.Int32
b. Object
c. No. of effected records
d. None of the above
Answer  Explanation 

ANSWER: Object

Explanation:
No explanation is available for this question!


9)   You want to make a configuration setting change that will affect only the current Web application. Which file will you change?

a. Global.asax
b. Web.config in the root of the Web application
c. Machine.config
d. All of the above
Answer  Explanation 

ANSWER: Web.config in the root of the Web application

Explanation:
No explanation is available for this question!


10)   Which programming model should you implement if you want to separate your server-side code from your client-side layout code in a Web page?

a. Single-file model
b. Code-behind model
c. Inline model
d. Client-server model
Answer  Explanation 

ANSWER: Code-behind model

Explanation:
No explanation is available for this question!


11)   Which object in ASP.NET provides a global storage mechanism for state data that needs to be accessible to all pages in a given Web application?

a. Session
b. Application
c. ViewState
d. None of the above
Answer  Explanation 

ANSWER: Application

Explanation:
No explanation is available for this question!


12)   Which Session Mode Serialization is not required to store the data?

a. Off
b. InProc
c. StateServer
d. SQLServer
Answer  Explanation 

ANSWER: InProc

Explanation:
No explanation is available for this question!


13)   You are a Web developer for CareerRide. The data is stored in a Microsoft SQL Server 2005 database on a server named CareerPC and the Database name is TestDB. There is one GridView control on the page that you want to fill with table name Employee. Suppose that SqlConnection object is conObj and SqlCommand Object object is cmdObj. Which important properties of command object you will initialize to achieve this task?

a. cmdObj.CommandType = Text;
 cmdObj.Connection = conObj;
 cmdObj.CommandText = "select * from Employee";
b. cmdObj.CommandConnection = conObj;
 cmdObj.CommandText = "select * from Employee";
c. cmdObj.CommandType = CommandType.Text;
 cmdObj.Connection = conObj;
 cmdObj.CommandText = "select * from Employee";
d. None of the above.
Answer  Explanation 

ANSWER: cmdObj.CommandType = CommandType.Text;
 cmdObj.Connection = conObj;
 cmdObj.CommandText = "select * from Employee";

Explanation:
No explanation is available for this question!


14)   How will you create the SQL Server Connection Objects in Code? Choose the correct option.

a. SqlConnection con = new SqlConnection ("Data Source=ServerName; Initial Catalog=DatabaseName;Integrated Security=True");
b. SqlConnection con = new SqlConnection();
 con.ConnectionString = ("Data Source=ServerName; Initial Catalog=DatabaseName;Integrated Security=True");
c. using (SqlConnection con = new SqlConnection("Data Source=ServerName; Initial Catalog=DatabaseName;Integrated Security=True"))
 {
 con.Open();
 - - - - - -
 - - - - - -
 }
d. All of the above codes are correct.
Answer  Explanation 

ANSWER: All of the above codes are correct.

Explanation:
No explanation is available for this question!


15)   Which of the following statements about referencing master page methods and properties is true?

a. Content pages can reference controls in the master page.
b. Content pages can reference public properties in the master page.
c. Content pages can reference public methods in the master page.
d. All of the above.
Answer  Explanation 

ANSWER: All of the above.

Explanation:
No explanation is available for this question!


16)   Choose the correct option about Master Page and Theme.

a. A Master Page enables you to share content across multiple pages in a website and A Theme enables you to control the appearance of the content.
b. Theme enables you to share content across multiple pages in a website and A Master Page enables you to control the appearance of the content.
c. App_Themes folder contains skin files.
d. Option A and C are correct.
Answer  Explanation 

ANSWER: Option A and C are correct.

Explanation:
No explanation is available for this question!


17)   When should you use HTML Server control rather than Web Server controls?

a. You are migrating existing, classic ASP pages over to ASP.NET pages.
b. The control needs to have custom client-side JavaScript attached to the control’s events.
c. The Web page has lots of client-side JavaScript that is referencing the control.
d. All of the above.
Answer  Explanation 

ANSWER: All of the above.

Explanation:
No explanation is available for this question!


18)   Which property will you set for each RadioButton Control in the group?

a. Specify the same GroupName for each RadioButton.
b. Specify the different GroupName for each RadioButton.
c. Specify the same GroupID for each RadioButton.
d. Specify the same ID for each RadioButton.
Answer  Explanation 

ANSWER: Specify the same GroupName for each RadioButton.

Explanation:
No explanation is available for this question!


19)   Which file contains settings for all .NET application types, such as Windows, Console, ClassLibrary, and Web applications?

a. Web.config
b. Machine.config
c. Global.asax
d. All of the above
Answer  Explanation 

ANSWER: Machine.config

Explanation:
No explanation is available for this question!


20)   Which object data is included in bookmarks and e-mailed URLs?

a. ViewState
b. cookies
c. Query strings
d. All of the above
Answer  Explanation 

ANSWER: Query strings

Explanation:
No explanation is available for this question!


21)   If you want to validate the email addresses, Social Security numbers, phone numbers, and dates types of data, which validation control will be used?

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

ANSWER: RegularExpressionValidator

Explanation:
No explanation is available for this question!


22)   When should you use the OleDbConnection object?

a. When connecting to an Oracle database.
b. When connecting to an Office Access database
c. When connecting to SQL Server 2000
d. None of the above
Answer  Explanation 

ANSWER: When connecting to an Office Access database

Explanation:
No explanation is available for this question!


23)   In a SQL Statement while working with SqlCommand it returns a single value, at that time which method of Command Object will be used?

a. ExecuteNonQuery
b. ExecuteReader
c. ExecuteScalar
d. All of the above
Answer  Explanation 

ANSWER: ExecuteScalar

Explanation:
No explanation is available for this question!


24)   According to the given below statements, choose the correct option.

Statement 1: Application caching is the process of storing data (and not pages) in a cache object.
Statement 2: Page output caching stores a rendered page, portion of a page, or version of a page in memory.
Statement 3: Caching reduces the time required to render cached page in future requests.


a. Only statement 1 is correct.
b. Statement 2 and 3 are correct.
c. Only statement 3 is correct.
d. All statements are correct.
Answer  Explanation 

ANSWER: All statements are correct.

Explanation:
No explanation is available for this question!