Strange problem with my code - please, look at it:
@Url.Action("IdeaVote","Ideas", new { IdeaID = "1", vote = "For" })
values in method (get from debugger):
IdeaID=1, vote=null
And now some magic tips (reverse vote and IdeaID).
@Url.Action("IdeaVote","Ideas", new { vote = "For", IdeaID = "1" })
Again values in method (get from debugger):
vote=for, IdeaID=null
Method IdeaVote (parameters)
public int IdeaVote(string vote, string IdeaID)
My question is - Why second argument is always null? Why this situation happend?
Regards
EDIT:
My jQuery method with url.action
$.get("@Url.Action("IdeaVote","Ideas", new { IdeaID = "1", vote = "For" })",function(data)
{
if (data == 1) {
$("#imageVoteAgainst").css("border-width", 0);
$("#imageVoteFor").css("border-width", 1);
}
});