exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 1 question 62 discussion

Actual exam question from Microsoft's 70-486
Question #: 62
Topic #: 1
[All 70-486 Questions]

HOTSPOT -
You are developing an ASP.NET MVC application. The layout page of the application references the jQuery library. You develop a view that uses the layout page.
The view includes the following markup:

The application includes the following class:

When a user clicks the button, an AJAX call must retrieve the partial view and append it to the newBooks div element.
You need to implement the AJAX request.
How should you complete the relevant code? To answer, select the appropriate code segment from each list in the answer area.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Example:
$.ajax({
url: this.href,
cache: false,
success: function (html) { $("#fixedRows").append(html); }
});
References: ASP MVC3 - Using partial view to append new HTML elements to page https://stackoverflow.com/questions/15794783/asp-mvc3-using-partial-view-to-append-new-html-elements-to-page

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
hungry_ape9000
Highly Voted 5 years ago
FINAL ANSWER: url: '/Book/CreateNewBook' $("#newBooks").append(partialView);
upvoted 8 times
...
slobex
Most Recent 5 years ago
URL: http://blogs.interknowlogy.com/2014/08/01/mvc-series-part-1-dynamically-adding-items-part-1/
upvoted 1 times
...
zimzimzimma
5 years ago
It should be .html(partialView) and not .append(partialView). Why? .append appends the content to the END of the matched element. So if you click again, it's appended again and you get duplicate data. .html(partialView) sets the html content inside the set of matched elements. So if you click again it overwrites the previous call.
upvoted 2 times
mr_
4 years, 12 months ago
I think you are wrong. Read the requirements: "When a user clicks the button, an AJAX call must retrieve the partial view and append it to the newBooks div element." So append, not replace.
upvoted 6 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...