ASP.Net/ASP.Net Mcq Question Set 3 Sample Test,Sample questions

Question:
 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 implement this solution on a single Web page?

1. ImageMap

2. Panel

3.Wizard

4.None of the above.


Question:
 ASP.NET Validation Control works at ____

1.Client side only.

2. Server side only.

3.Both Client Side and Server Side

4.None of the above.


Question:
 In ASP.NET application DLL files are stored in which folder?

1.App_Code

2.App_Data

3.Bin

4.App_LocalResources


Question:
 The following group profile properties defined under a group name in Web.config file. How will you access Street and City property?

<properties>
<group name="Address">
<add name="Street" />
<add name="City" />
</group>
</properties>

1.Profile.name.Street - Profile.name.City

2.Profile.Address.Street - Profile.Address.City

3.Address.Street - Address.City

4.None of the above.


Question:
 The three statements are given below about DataSet and DataReader, choose the correct option according to the statement.

Statement 1: DataSet Provides Disconnected environment but DataReader provides Connected environment.
Statement 2: DataSet Provides Connected environment but DataReader provides Disconnected environment.
Statement 3: DataSet Can store multiple table simultaneously but DataReader Supports a single table based on a single SQL query.

1.Only Statement 1 is correct.

2.Statement 1 and 2 is correct.

3.Statement 2 and 3 is correct.

4.Statement 1 and 3 is correct.


Question:
 What are the steps to create a DataTable programmatically?

1.Instantiate a new DataTable and add DataColumn objects to the DataTable. Columns Collection.

2.Run the Data Source Configuration Wizard.

3.Instantiate a new DataSet object.

4.None of the above.


Question:
 What are the three primary kinds of parameters are used while working with the Stored Procedure in ASP.NET?

1.Input, Integer, String

2.int, varchar, nvarchar

3.Input, Output, InputOutput

4.All of the above.


Question:
 What are the types of Web Server Button Controls that can be created?

1.Only Submit buttons

2.Only Command buttons

3.Submit and command buttons

4.None of the above.


Question:
 What is/are the advantages of Session State?

1. It helps to maintain user data to all over the application and can store any kind of object.

2.Stores every client data separately.

3.Session is secure and transparent from user.

4.All of the above


Question:
 What types of data can you store in the Cache collection?

1.Only String Type of Data

2.You can store any type of data in the Cache collection.

3.Only DataSet Object

4. All of the above.


Question:
 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?

1. Session

2. Application

3.ViewState

4.none of the above


Question:
 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?

1.Single-file model

2.Code-behind model

3. Inline model

4.Client-server model


Question:
 Which Session Mode Serialization is not required to store the data?

1. Off

2.InProc

3.StateServer

4.SQLServer


Question:
 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. You connect to TestDB by using Windows Integrated authentication. You use a SqlConnection object to connect to the database. You need to create a connection string to TestDB in the instance of SQL Server named CareerPC. Which string should you use?

1. “Data Source= CareerPC; Database=TestDB; Integrated Security=SSP1”.

2. “Data Source= CareerPC; Initial Catalog=TestDB; Integrated Security=SSP1”.

3.“Server= CareerPC; Database=TestDB; Integrated Security=SSP1”.

4. All of the above.


Question:
 You want to secure the connection strings contained within your Web.config file to ensure that no one can open the file easily and see the connection information. Which tool must you use to encrypt the connection strings?

1.ASPNET_WP.EXE

2. ASPNET_REGSQL.EXE

3.ASPNET_REGIIS.EXE

4.None of the above.


Question:
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?

1.AsyncPostBackTrigger

2.ScriptManager

3.ScriptManagerProxy

4.None of the above.


Question:
Choose the correct option about DataReader object.

1.DataReader object is a forward-only object.

2.It provides connection oriented environment.

3. DataReader is read only object.

4. All of the above


Question:
Choose the correct option about DataSet object.

1.Provides Disconnected mode

2.Can store multiple table simultaneously

3.Consumer Object

4.All of the above.


Question:
Choose the correct option about Master Page and Theme.

1.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.

2.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.

3.App_Themes folder contains skin files.

4.Option A and C are correct.


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

1. Set the AutoPostBack property to true.

2.Add JavaScript code to call the ForcePostBack method.

3.Set the PostBackAll property of the Web Page to true.

4.none of the above


Question:
How do you create a TextBox for retrieving a password from a user?

1.Set TextMode property of the TextBox control to Secret.

2. Set Mode property of the TextBox control to Password.

3.Set Text property of the TextBox control to Password.

4. Set TextMode property of the TextBox control to Password.


Question:
How do you execute multiple SQL statements using a DataReader?

1. Call the ExecuteReader method of a single Command object twice.

2.Set the Command.CommandText property to multiple SQL statements delimited by a semicolon.

3.Set the Command.CommandType property to multiple result sets.

4.None of the above.


Question:
How many types of parameter supported by OutputCache?

1.VaryByParam

2. VaryByControl

3. VaryByHeader

4.All of the above


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

1.SqlConnection con = new SqlConnection ("Data Source=ServerName; Initial Catalog=DatabaseName;Integrated Security=True");

2. SqlConnection con = new SqlConnection(); con.ConnectionString = ("Data Source=ServerName; Initial Catalog=DatabaseName;Integrated Security=True");

3.using (SqlConnection con = new SqlConnection("Data Source=ServerName; Initial Catalog=DatabaseName;Integrated Security=True")) { con.Open(); - - - - - - - - - - - - }

4.All of the above codes are correct.


Question:
How will you store and retrieve value in viewstate?

1. // Storing the data in viewstate ViewState[“SiteName”]=”CareerRide”; // Retrieving Value from a View State Label1.Text = ViewState["SiteName "].ToString();

2.// Storing the data in viewstate ViewState obj=new ViewState ViewState [obj]=”CareerRide”; // Retrieving Value from a View State Label1.Text = ViewState[obj].ToString();

3. // Storing the data in viewstate ViewState=”CareerRide”; // Retrieving Value from a View State Label1.Text = ViewState.ToString();

4.None of the above.


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

1.getXMLData

2.getXML

3.ExecuteXMLReader

4. None of the above.


Question:
Match the following List 1 (Controls) to List 2.

a. Image ------------------------- i. Navigate, PostBack, Inactive HotSpotMode
b. ImageButton ---------------- ii. Container control
c. ImageMap ------------------- iii. Has command event
d. MultiView ------------------- iv. Does not have click event

1.a-iv, b-iii, c-i, d-ii

2.a-ii, b-iv, c-i, d-iii

3. a-ii, b-i, c-iii, d-iv

4. a-iv, b-iii, c-i, d-ii


Question:
Match the following List 1 to List 2

a. App_Code ------------------------ i.  Assembly Resource Files (.resx)
b. App_Data ------------------------ ii. .skin file, CSS files
c. App_Themes -------------------- iii. .mdf file, .mdb file
d. App_GlobalResources --------- iv. .wsdl files, typed datasets

1.a-iv, b-iii, c-ii, d-i

2. a-ii, b-iv, c-i, d-iii

3.a-ii, b-i, c-iii, d-iv

4. a-ii, b-iv, c-iii, d-i


Question:
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

1.a - iii b - ii c - iv d - i

2. a - ii b - iii c - iv d - i

3. a - i b - ii c - iv d - iii

4.a - i b - ii c - iii d – iv


Question:
Match the following List 1 with List 2:

a. Control ------------------ i. Controls the output caching policies of a page or user control.
b. MasterType ------------ ii. Page directive uses with user controls.
c. PreviousPageType ---- iii. Enables an ASP.NET page to work with a postback from another page in the application.
d. OutputCache ----------- iv. Associates a class name to a page to get references or members contained within the specified master page.

1. a-ii, b-i, c-iv, d-iii

2.a-ii, b-iv, c-i, d-iii

3.a-ii, b-i, c-iii, d-iv

4.a-ii, b-iv, c-iii, d-i


Question:
Some control, by default, does not cause an automatic PostBack, i.e TextChanged event of TextBox. Which property will you set for automatic postback of these types of controls?

1.isPostBack=”false”

2.isPostBack=”true”

3.PostBack=”true”

4.AutoPostBack=”true”


Question:
The UpdatePanel supports two types of triggers: AsyncPostBackTrigger and PostBackTrigger. Choose the correct option regarding working of these triggers.

1.AsyncPostBackTrigger causes an asynchronous (Ajax) postback.

2.PostBackTrigger causes a normal entire-page postback.

3.AsyncPostBackTrigger causes a normal entire-page postback.

4.Option A and B are correct.


Question:
To implement a specified .NET Framework interface which directive is used?

1.@Register

2.@Control

3.@Reference

4.@Implements


Question:
What are the basic steps to reference master page properties from a content page?

1.Create a property in the master page code-behind file. - Reference the master page property from the content page using the syntax Master.<Property_Name>

2.Create a property in the master page code-behind file. - Add the @ MasterType declaration to the .aspx content page. - Reference the master page property from the content page using the syntax Master.

3.Create a property in the master page code-behind file. - Reference the master page property from the content page using the syntax Master.<Property_Name>

4.none of the above


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

1.Data Source - Initial Catalog - Integrated security=true

2.Server - Database - Integrated security=true

3.Option A and B both are correct

4. None of the above


Question:
What datatype is returned when calling the ExecuteScalar method of a command object?

1. System.Int32

2.Object

3.No. of effected records

4.none of the above


Question:
What happen in the Web Page when Init event occur?

1.ViewState is loaded on the page.

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

3.HTML is rendered.

4.none of the above


Question:
What is the difference between a Local Transaction and a Distributed Transaction?

1. Local transactions are performed on a single database table, but distributed transactions are performed on more than one database tables.

2. Local transactions are performed on a single database server, but distributed transactions can be performed across multiple database servers.

3.Local transactions are performed on a database on the local machine, but distributed transactions are performed on a database on a remote machine.

4.None of the above.


Question:
What is the easiest way in Design view to create an event handler for the default event of a server control?

1. Open the code-behind page and write the code.

2.Right-click the control and select Create Handler.

3.Drag an event handler from the Toolbox to the desired control.

4.Double-click the control.


Question:
What is/are the advantages of StateServer session mode?

1.Its keeps the data separate from IIS so; if any Issue comes with IIS it will not hamper Session data.

2.It is useful in web farm and web garden scenarios.

3.Process is fast due to serialization and de-serialization.

4.A and B are the correct option.


Question:
When a User’s Session times out which event should you respond to?

1.Application_Start

2.Session_End

3.Session_Start

4.Application_End


Question:
When should you use HTML Server control rather than Web Server controls?

1.You are migrating existing, classic ASP pages over to ASP.NET pages.

2.The control needs to have custom client-side JavaScript attached to the control’s events.

3.The Web page has lots of client-side JavaScript that is referencing the control.

4.All of the above.


Question:
Which ADO.NET class provide Connected Environment?

1. DataReader

2.DataSet

3.Command

4.none of the above


Question:
Which file is used to write the code to respond to the Application_Start event?

1.Any ASP.NET web page with an .aspx extension

2.Web.config

3.Global.asax

4.None of the above.


Question:
Which of the following is not an ASP.NET page event?

1.Init

2.Load

3. Import

4.None of the above.


Question:
Which of the following Web.config files correctly enables the Web application to track the LastVisit of anonymous users in a variable of type DateTime?

1.<anonymousIdentification enabled="true"/> <profile> <properties> <add name="LastVisit" type="System.DateTime" allowAnonymous="true" /> </properties> </profile>

2.<anonymousIdentification enabled="true"/> <profile> <properties> <add name=" LastVisit " allowAnonymous="true" /> </properties> </profile

3.<anonymousIdentification enabled="true" /> <profile> < properties> < add name=" LastVisit " type="System. DateTime " /> </properties> </p

4.<profile> <properties> <add name="LastVisit" type="System. DateTime "/> </properties> </profile>


Question:
Windows-Based Authentication is well suited for ______

1.Intranet environment

2.Public web site

3. Desktop application

4.none of the above


Question:
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?

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

2.cmdObj.CommandConnection = conObj; cmdObj.CommandText = "select * from Employee";

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

4.None of the above.


Question:
You are developing a Web page that contains many validated controls. You want to provide a detailed message for each validation error, but the page doesn’t have sufficient space to provide the detailed message next to each control. What can you do to indicate an error at the control and list the detailed error messages at the top of the Web page?

1.- Set the Text property of the validator control to the detailed message. - Set the ErrorMessage property to an asterisk (*). - Place a ValidationSummary control at the top of the Web page.

2.Set the ErrorMessage property of the validator control to the detailed message. - Set the Text property to an asterisk (*). - Place a ValidationSummary control at the top of the Web page.

3.Set the ToolTip property of the validator control to the detailed message. - Set the ErrorMessage property to an asterisk (*). - Place a ValidationSummary control at the top of the Web page.

4. None of the above


Question:
You are writing a page that contains an UpdatePanel for partial-page updates. You want that user should get the message “Processing is going on, please wait.” that the update is processing only if the update takes longer than 5 seconds. Which actions should you take?

1.Add a ProgressBar control to the page. Set the Interval property to 5000. Set the text property as “Processing is going on, please wait.”

2.Add a Timer control to the page. Set the Interval property to 5000. Set its text property to Processing is going on, please wait.”

3.Add an UpdateProgress control to the UpdatePanel. Set its DisplayAfter property to 5000. Set its ProgressTemplate contents to read “Processing is going on, please wait.”

4.None of the above.


More MCQS

  1. ASP.Net Mcq Question Set 1
  2. ASP.Net Mcq Question Set 2
  3. ASP.Net Mcq Question Set 3
  4. ASP.Net Mcq Question Set 4
  5. ASP.Net Mcq Question Set 5
  6. ASP.Net Mcq Question Set 6
  7. ASP.Net Mcq Question Set 7
  8. ASP.Net Mcq Question Set 8
  9. ASP.Net Mcq Question Set 9
  10. ASP.Net Mcq Question Set 10
  11. ASP.Net Mcq Question Set 11
  12. ASP.Net Mcq Question Set 12
  13. ASP.Net Mcq Question Set 13
  14. ASP.Net Mcq Question Set 14
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!