Reputation: 5
I'm getting a list of data and displayed it using angularjs inside table.
<tr dir-paginate="entit in testing>
<td>{{entit.ExerciseName}}</td>
<td>{{entit.Name}}</td>
<td>{{entit.StartingDate}}</td>
<td>{{entit.EndDate}}</td>
</tr>
Now my question is how do I get ExerciseName value to send it to my controller after I click the link?
@Html.EncodedActionLink("View History", "NationalHistory", "Applicant/Testing", new {ExerciseName = (How do I set the value at here) }, new { @class = "btn btn-success btn-sm btn-block"})
By the way I'm using @Html.EncodedActionLink that I'm getting from this link : https://dotnettrace.net/2013/09/19/encrypt-and-decrypt-url-in-mvc-4/
Please help....
Upvotes: 0
Views: 158
Reputation: 16609
The Razor code (@Html.EncodedActionLink(...)
) is run on the server before the page is rendered by the browser and available for Angular to interact with. Therefore you cannot just get Angular to plug in the data later.
You will need to make an ajax call from your Angular controller/service, probably using the Angular $http
service (assuming your tag is correct and you are using Angular 1.x).
Upvotes: 1