what you are returning from the method is a html string not a json string which is expected by the ajax call (
contentType: "application/json",dataType: "json",
)
So you have two choices 1) change the sample method to return as a json string or 2) remove the
contentType
and
dataType
from your ajax method - jquery by default infers the correct type, in this case html.
hope this solves your problem.