You are on page 1of 4

ASP.

NET

1. Match the following List 1 to List 2

List 1 ---------------------- List 2


a. Literal Control----------i. SingleLine, MultiLine, Password
b. Label Control------------ii. CommandName
c. TextBox Control----------iii. Convert to span tag in HTML
d. Button Control-----------iv. PassThrough, Encode, Transform mode
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-iv, b-iii, c-i, d-ii

Answer: D

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

3. What are the minimum attribute 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: C

4. Choose the correct option about storing Multiple Values in a Cookie.

A) Response.Cookies["visit"].Value = DateTime.Now.ToString();
Response.Cookie["WebsiteName"].Value = "AIPDM";
Response.Cookies["color"].Value = "blue";
B) Response.Cookies.Value = DateTime.Now.ToString();
Response.Cookies.Value = "AIPDM";
Response.Cookies.Value = "blue";
C) Response.Cookies["info"]["visit"].Value = DateTime.Now.ToString();
Response.Cookies["info"]["WebsiteName"].Value = "AIPDM";
Response.Cookies["info"]["color"].Value = "blue";
Response.Cookies["info"].Expires = DateTime.Now.AddDays(1);
D) None of the above.
Answer: C

5. In which session mode serialization is not required to store the data?

A) Off B) InProc
C) StateServer D) SQLServer
Answer: B

6. You are creating an ASP.NET application for a company. 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: A

7. Match the correct code:

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

8. 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?

A) Add a ProgressBar control to the page. Set the Interval property to 5000. Set the text property as
“Processing is going on, please wait.”
B) Add a Timer control to the page. Set the Interval property to 5000. Set its text property to Processing is
going on, please wait.”
C) 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.”
D) None of the above.
Answer: C

9. 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: A

10. Cache["dd"]="asp.net";

What is the time period of this Cache object?

A) Infinite B) 0 seconds
C) 20 seconds D) None of these
Answer: B

11. What is the default MaxStringContentLength for WCF Service?

A) 8192 bytes B) 65536 bytes


C) 2147483647 byte (int max value) D) None of the above
Answer: A

12. what maxItemsInObjectGraph property of DataContractSerializer mean?

A) Max size of DataContract


B) Max Number of Items inside DataContract
C) Max number of items that can be searialize/deserialized in a single WCF call
D) None of the above
Answer: C

13. Which of the following code is correct?

A) < TextBlock>This is my < HyperLink NavigateUri=”MyPage.xaml”>Hyperlink< / Hyperlink>


< /TextBlock>
B) < TextBlock>This is my < HyperLink NavigateUri=”MyPage.aspx”>Hyperlink< / Hyperlink><
/TextBlock>
C) < TextBlock>This is my < HyperLink Navigate=”MyPage.xaml”>Hyperlink< / Hyperlink><
/TextBlock>
D) < TextBlock>This is my < HyperLink Navigate=”MyPage.aspx”>Hyperlink< / Hyperlink><
/TextBlock>
Answer: A

14. You are creating an ASP.NET MVC web application, and you decide to create a new layout for
mobile devices with relatively small screens. Which @media query should you create or modify to
accomplish the task? (Choose all that apply.)

A) @media(max-width:768px) B) @media (max-width:478px) and (orientation:portrait)


C) @media (min-width:768px) and (orientation:portrait) D) A and B both
Answer: D

15. You are implementing an ASP.NET MVC 2 Web application. The URL with path /Home/Details/
{country} will return a page that provides information about the named country. You need to
ensure that requests for this URL that contains an unrecognized country value will not be processed
by the Details action of HomeController.What should you do?

A) Add the ValidateAntiForgeryToken attribute to the Details action method.


B) Add the Bind attribute to the country parameter of the Details action method. Set the attribute's Prefix
property to Country.
C) Create a class that implements the IRouteConstraint interface. Configure the default route to use this
class.
D) All of the Above
Answer: C

Q 16 - You are implementing an ASP.NET MVC 2 Web application. The URL with
path
/Home/Details/{country} will return a page that provides information about
the
named country. You need to ensure that requests for this URL that contains
an
unrecognized country value will not be processed by the Details action of
HomeController.What should you do?
A - Add the ValidateAntiForgeryToken attribute to the Details action method.
B - Add the Bind attribute to the country parameter of the Details action method. Set
the
attribute's Prefix property to Country.
C - Create a class that implements the IRouteConstraint interface. Configure the default
route to
use this class.
D - Create a class that implements the IRouteHandler interface. Configure the default
route to
use this class.
E - A and D both
F - All of the above

You might also like