When I return a view with a List as a model, the code looks like this:
List<Indications.Analysis.PrepaymentResult> resultsList = Indications.Analysis.PrepaymentResult.GetPrepaymentResult(indication.Model.Trx, indication.Model.ShockBpsDropList.Value, indication.Model.ShockIncrements.Value);
return View(@"~\Views\Indications\TermSheetViews\Swap\PrePayment.aspx", resultsList);
- While this code compiles, is it advisable to do so?
I need to interact with this list using JavaScript. I have previously obtained lists in JSON format through AJAX calls on different pages but can't do so here. In this scenario, how can I work with the list passed in through JavaScript, using the following method:
CreateShockTable(data.prepaymentList, "TotalValueString", "#valueTable", "Prepayment Value");
The list referred to as prepaymentList
is the one being mentioned.