Here is a spot that I want to update:
<div style="text-align: center;" id="vote_count">@Html.DisplayFor(q => q.VoteCount)</div>
Here is my actionLink:
@Ajax.ActionLink("Upvote", "Upvote", "Author", new { QuestionID = Model.QuestionID, @class = "upvote" },
new AjaxOptions
{
InsertionMode = InsertionMode.Replace,
UpdateTargetId = "vote_count",
OnBegin = "onBegin",
OnComplete = "onComplete",
OnSuccess = "onSuccess",
OnFailure = "onFailure"
})
And here is one of my controllers:
public int Upvote(Guid QuestionID)
{
if ()
{
//I want to send error message
}
else
{
//I want to send an integer
}
}
And my question: I want to send error message or an integer to my view page to show it. How can I do it? From advices that you have recommended, I can change all codes.
Thanks.