【发布时间】:2014-07-29 20:21:45
【问题描述】:
只是一点背景知识:我正在创建一个 ASP.NET MVC Web 应用程序。
在我的主页中,我使用 AngularJS 创建了几个表行,虽然我可以在客户端访问它们,但我的最终目标是使用 vb.net 在服务器端处理数据。向正确方向轻推将不胜感激。谢谢你。
这是我的 AngularJS 控制器,用于向我的 html 表动态添加行。
function TableController($scope){
$scope.requests = [];
$scope.addCertificate = function () {
var certificate = {
emailAddress: $scope.emailAddress,
certificateType: $scope.certificateType,
searchType: $scope.searchType,
submittedNumbers: $scope.submittedNumbers,
};
$scope.requests.push(certificate);
};
$scope.removeCertificate = function (index) {
$scope.requests.splice(index, 1);
};
}
【问题讨论】:
-
我不了解 ASP,但是如果您传递多个具有相同名称的值,则应该有一些标准转换为数组。您可以比较具有相同索引的项目以了解哪些与哪些相关。另一种选择是在请求正文中发送完整的 JSON,然后在服务器端解析它。