I'm currently working with asp.net mvc 3 and have the following code in my view:
<%
foreach(Team t in Model.AvailableTeams.AvailableTeams)
{ %>
<%= Ajax.ActionLink(t.Title
, "InviteTeamToChallenge"
, "Challenge"
, new{id = t.TeamId
, challengeId = Model.ChallengeId
, teamId = t.TeamId
, invitedByUserId = Model.userId}
, new AjaxOptions
{
OnSuccess = "hideLabel(teamId)"
} ) %>
<% } %>
I am attempting to pass the teamId to a JavaScript function that will hide the action link after it is clicked. However, the javascript method is not being triggered. Below is my current javascript code:
function hideLabel(teamId) {
alert("in JS");
alert(teamId);
$('.teamId').hide();
}
In addition to this issue, I also want to refresh a partial view on the page that displays the selected teams once this problem is resolved.