This can be achieved by returning ContentResult MSDN
return Content("<script language='javascript' type='text/javascript'>alert('Hello world!');</script>");
or other way would be making use of ajax
return json(new {message="hello"});
$.ajax({
url: URL,
type: "POST",
success: function(data){alert(data.message)},
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…