10
Microsoft 70-515 TS: Web Applications Development with Microsoft .NET Framework 4 10 Q&A Version 3.0 http://www.insidetests.com/70-515.htm

Insidetests 70-515 Exam - Web Applications Development with Microsoft .NET Framework 4

Embed Size (px)

DESCRIPTION

Insidetests offers Microsoft 70-515 questions and answers for your Web Applications Development with Microsoft .NET Framework 4 exam preparation. Download 70-515 free sample to check the quality.

Citation preview

Page 1: Insidetests 70-515 Exam - Web Applications Development with Microsoft .NET Framework 4

Microsoft 70-515TS: Web Applications Development with Microsoft .NET Framework 4

10 Q&A

Version 3.0

http://www.insidetests.com/70-515.htm

Page 2: Insidetests 70-515 Exam - Web Applications Development with Microsoft .NET Framework 4

Leading the way in IT testing and certification tools, www.InsideTests.com

- 2 -

Important Note, Please Read Carefully

Other 70-515 productsA) Offline Testing engineUse the offline Testing engine product topractice the questions in an exam environment.

Build a foundation of knowledge which will be useful also after passing the exam.

Latest VersionWe are constantly reviewing our products. New material is added and old material isrevised. Free updates are available for 90 days after the purchase. You should check yourmember zone at 70-515 and update 3-4 days before the scheduled exam date.

Here is the procedure to get the latest version:

1.Go towww.70-515.com2.Click on Log in3.The latest versions of all purchased products are downloadable from here. Just click thelinks.For most updates,it is enough just to print the new questions at the end of the newversion, not the whole document.

FeedbackIf you spot a possible improvement then please let us know. We always interested inimproving product quality.Feedback should be send to [email protected]. You should include the following:Exam number, version, page number, question number, and your login Email.

Our experts will answer your mail promptly.

CopyrightEach iPAD file is a green exe file. if we find out that a particular iPAD Viewer file isbeing distributed by you, 70-515 reserves the right to take legal action against youaccording to the International Copyright Laws.

ExplanationsThis product does not include explanations at the moment. If you are interested inproviding explanations for this exam, please contact [email protected].

Page 3: Insidetests 70-515 Exam - Web Applications Development with Microsoft .NET Framework 4

Leading the way in IT testing and certification tools, www.InsideTests.com

- 3 -

www.70-515.com Q: 1 Question: 1You are implementing an ASP.NET application that uses data-bound GridViewcontrols inmultiple pages. You add JavaScript code to periodically update specific types ofdata items inthese GridView controls. You need to ensure that the JavaScript code can locate theHTMLelements created for each row in these GridView controls, without needing to bechanged if thecontrols are moved from one pa to another. What should you do?

A. Replace the GridView control with a ListView control.

B. Set the ClientIDMode attribute to Predictable in the web.config file.

C. Set the ClientIDRowSuffix attribute of each unique GridView control to a differentvalue.

D. Set the @ OutputCache directive¡¯s VaryByControl attribute to the ID of theGridView control.

Answer: C

www.70-515.com Q: 2 Question: 10You are implementing an ASP.NET application that includes the followingrequirements. Retrievethe number of active bugs from the cache, if the number is present. If the number isnot found inthe cache, call a method named GetActiveBugs, and save the result under theActiveBugs cachekey. Ensure that cached data expires after 30 seconds. You need to add code tofulfill therequirements. Which code segment should you add?

Page 4: Insidetests 70-515 Exam - Web Applications Development with Microsoft .NET Framework 4

Leading the way in IT testing and certification tools, www.InsideTests.com

- 4 -

A. Dim numOfActiveBugs As Integer? = DirectCast(Cache("ActiveBugs"), Integer?) IfNotnumOfActiveBugs.HasValue Then Dim result As Int32 = GetActiveBugs()Cache.Insert("ActiveBugs", result, Nothing, DateTime.Now.AddSeconds(30),Cache.NoSlidingExpiration) numOfActiveBugs = result End If ActiveBugs =numOfActiveBugs.Value

B. Dim numOfActiveBugs As Integer = CInt(Cache.Get("ActiveBugs")) IfnumOfActiveBugs <> 0Then Dim result As Integer = GetActiveBugs() Cache.Insert("ActiveBugs", result,Nothing,DateTime.Now.AddSeconds(30), Cache.NoSlidingExpiration) numOfActiveBugs =result End IfActiveBugs = numOfActiveBugs

C. Dim numOfActiveBugs As Integer = 0 If Cache("ActiveBugs") Is Nothing Then Dimresult AsInteger = GetActiveBugs() Cache.Add("ActiveBugs", result, Nothing,DateTime.Now.AddSeconds(30),Cache.NoSlidingExpiration, CacheItemPriority.Normal,Nothing) numOfActiveBugs = resultv End If ActiveBugs = numOfActiveBugs

D. Dim numOfActiveBugs As Integer = DirectCast(Cache("ActiveBugs"), Integer?) IfNotnumOfActiveBugs.HasValue Then Dim result As Integer = GetActiveBugs()Cache.Insert("ActiveBugs", result, Nothing, Cache.NoAbsoluteExpiration,TimeSpan.FromSeconds(30)) numOfActiveBugs = result End If ActiveBugs =numOfActiveBugs.Value

Answer: A

www.70-515.com Q: 3 Question: 100You create a Web page that contains the following image element.<img id="myImage" src="/image1.png" />You need to write a JavaScript function that will dynamically change which imageis displayed.Which code segment should you use?

A. function changeImage() { myImage.src = "image2.png"; }

Page 5: Insidetests 70-515 Exam - Web Applications Development with Microsoft .NET Framework 4

Leading the way in IT testing and certification tools, www.InsideTests.com

- 5 -

B. function changeImage() { document.getElementById("myImage").src ="image2.png"; }

C. function changeImage() { getElementById("myImage").src = "image2.png"; }

D. function changeImage() { window.getElementById("myImage").src = "image2.png";}

Answer: B

www.70-515.com Q: 4 Question: 101A Web page includes the HTML shown in the following code segmen <spanid="ref"> <aname=Reference>Check out</a> the FAQ on <a href="http://www.contoso.com">Contoso</a>'sweb site for more information:<a href="http://www.contoso.com/faq">FAQ</a>. </span> <ahref="http://www.contoso.com/home">Home</a> You need to write a JavaScriptfunction that willdynamically format in boldface all of the hyperlinks in the ref span. Which codesegment shouldyou use?

A. $("#ref").filter("a[href]").bold();

B. $("ref").filter("a").css("bold");

C. $("a").css({fontWeight:"bold"});

D. $("#ref a[href]").css({fontWeight:"bold"});

Answer: D

www.70-515.com Q: 5 Question: 102You create a Web page that contains the following div. <div id="target"> </div>You have aJavaScript array named imageurls that contains a list of image URLs. You need towrite a

Page 6: Insidetests 70-515 Exam - Web Applications Development with Microsoft .NET Framework 4

Leading the way in IT testing and certification tools, www.InsideTests.com

- 6 -

JavaScript function that will insert images from the URLs into target. Which codesegment shouldyou use?

A. $(imageurls).each(function(i,url){ $("<img/>", url).append("#target"); });

B. $(imageurls).each(function(i,url){ $("#target") += $("<img/>").attr("src", url); });

C. $.each(imageurls, function(i,url){ $("<img/>").attr("src", url).appendTo("#target");});

D. $.each(imageurls, function(i,url){ $("#target").append("<img/>").src = url; });

Answer: C

www.70-515.com Q: 6 Question: 103You create a Web page that contains the following code.<script type="text/javascript"> var lastId = 0; </script> <div class="File">Choose a file to upload:<input id="File0" name="File0" type="file" /> </div><input id="AddFile" type="button" value="Add a File" /><input id="Submit" type="submit" value="Upload" />You need to provide the following implementation. ?Each time the AddFile button isclicked, anew div element is created. ?The new div element is appended after the other fileupload divelements and before the AddFile span. ?Each new element has a unique identifier.Which codesegment should you use?

A. $("#AddFile").click(function () { var id = "File" + ++lastId; var item =$(".File:first").clone(true);$("input:file", item).attr({ id: id, name: id }); item.insertBefore("#AddFile"); });

B. $("#AddFile").click(function () { var id = "File" + ++lastId;$(".File:first").clone(true) .attr({ id: id,name: id }) .insertBefore("#AddFile"); });

Page 7: Insidetests 70-515 Exam - Web Applications Development with Microsoft .NET Framework 4

Leading the way in IT testing and certification tools, www.InsideTests.com

- 7 -

C. $("#AddFile").click(function () { var id = "File" + ++lastId;});

D. $("#AddFile").click(function () { var id = "File" + ++lastId; var item =$(".File:first").clone(true)$("input:file", item).attr({ id: id, name: id }); item.insertAfter("input[type=file]"); });

Answer: A

www.70-515.com Q: 7 Question: 104You are building an ASP.NET control. The control displays data by using a tableelement with aclass attribute value of Results. The control should expose a client-side event namedonrowselected that fires when a check box in a table row is selected. You need toimplement thisclient-side event. What should you do?

A. $('.Results input:checked').onrowselected = function (e, sender) { ¡- };

B. $('.Results input:checked').bind('onrowselected', function (e, sender) { ¡- });

C. $('.Results').bind('onrowselected', function (e, sender) { ¡- }).click(function (e) { if($(e.target).is('input:checked')) { $('.Results').trigger('onrowselected', [$(e.target)]); } });

D. $('.Results').onrowselected($.proxy($(this) .find('input:checked'), function (e, sender){ ¡- }));

Answer: C

www.70-515.com Q: 8 Question: 105You create a Web page that contains the following code. (Line numbers areincluded forreference only.)01<script>02function changeColor(c) {

Page 8: Insidetests 70-515 Exam - Web Applications Development with Microsoft .NET Framework 4

Leading the way in IT testing and certification tools, www.InsideTests.com

- 8 -

03message.style.color=c;04}05</script>0607<p id="message">Welcome!</p>08<ul id="color">09<li>Black</li>10<li>Red</li>11</ul>You need to ensure that when the user clicks an item in the list, the text color of the¡°Welcome!¡±message will change. Which declaration should you use?

A. <ul id="color"> <li onclick="changeColor(this.innerText);">Black</li> <lionclick="changeColor(this.innerText);">Red</li> </ul>

B. <ul id="color"> <li onclick="changeColor(this.style.color);">Black</li> <lionclick="changeColor(this.style.color);">Red</li> </ul>

C. <ul id="color"> <li><a onfocus="changeColor(this.innerText);">Red</a></li><li><aonfocus="changeColor(this.innerText);">Black</a></li> </ul></ul>

D. <ul id="color">

Answer: A

www.70-515.com Q: 9 Question: 106You are implementing an ASP.NET AJAX page. You add the following control tothe page.<asp:UpdatePanel ID="pnl1" runat="server" UpdateMode="Conditional"><ContentTemplate> ¡-</ContentTemplate> </asp:UpdatePanel>You need update the contents of the UpdatePanel without causing a full reload ofthe page.Which two actions should you perform? (Each correct answer presents part of thesolution.Choose two.)

Page 9: Insidetests 70-515 Exam - Web Applications Development with Microsoft .NET Framework 4

Leading the way in IT testing and certification tools, www.InsideTests.com

- 9 -

A. Add the following control before the UpdatePanel. <asp:Timer ID="Timer1"OnLoad="Timer1_Tick" runat="server" Interval="3000" />

B. Add the following control within the UpdatePanel. <asp:Timer ID="Timer1"OnLoad="Timer1_Tick" runat="server" Interval="3000" />

C. Add an AsyncPostBackTrigger that references Timer1.

D. Add a PostBackTrigger that references Timer1.

Answer: B, C

www.70-515.com Q: 10 Question: 107You are implementing an ASP.NET AJAX page. You add two UpdatePanel controlsnamed pnlAand pnlB. pnlA contains an UpdatePanel control named pnlAInner in its contenttemplate. Youhave the following requirements. ?Update panels pnlA and pnlB must refresh theircontent onlywhen controls that they contain cause a postback. ?Update panel pnlAInner mustrefresh itscontent when controls in either pnlA or pnlB or pnlAInner cause a postback. Youneed toconfigure the panels to meet the requirements. What should you do?

A. Set the UpdateMode of pnlA and pnlB to Conditional. Set the UpdateMode ofpnlAInner to Always.

B. Set the UpdateMode of pnlA and pnlB to Conditional. Set the UpdateMode ofpnlAInner toConditional, and add AsyncPostBackTrigger elements to its Triggers element for everycontrol in pnlA.

C. Set the UpdateMode of pnlA and pnlB to Always. Set the UpdateMode of pnlAInnerto Conditional.

Page 10: Insidetests 70-515 Exam - Web Applications Development with Microsoft .NET Framework 4

Leading the way in IT testing and certification tools, www.InsideTests.com

- 10 -

D. Set the UpdateMode of pnlA and pnlB to Always. Set the UpdateMode of pnlAInnerto Always,and add AsyncPostBackTrigger elements to its Triggers element for every control inpnlB.

Answer: A