[英]Changes made in a custom StackLayout (when running) don't appear in the view (Xamarin.Forms)
[英]Changes don't automatically appear on the view (AngularJS update)
在我的ASP.Net/MVC应用程序中,我使用AngularJS来显示数据库中的记录列表。 当我更新记录时,在刷新页面之前,该记录不会在视图(html)中更新吗?
风景:
<tr ng-repeat="bu in bus">
<td>{{bu.BU_Name}}</a></td>
<td>{{bu.BU_Info}}</a></td>
<th><a href="javascript:void(0)" ng-click="editItem(bu)">Del</a></th>
</tr>
JS:
$scope.editItem= function (bu) {
$http.post('/CO/DelBU', {dbunt: bu})
.then(function (response) {
$scope.bus = response.data;
})
.catch(function (e) {
console.log("error", e);
throw e;
})
.finally(function () {
console.log("This finally block");
});
};
MVC控制器:
[HttpPost]
public JsonResult DelBU(BUs dbunt)
{
var db = new scaleDBEntities();
var burecord = db.Buses.Find(dbunt.BU_ID);
db.Database.ExecuteSqlCommand("UPDATE dbo.BUs SET BU_Name='just a test'");
var burecords = db.Buses.ToList();
return Json(burecords, JsonRequestBehavior.AllowGet);
}
因此,当我单击“编辑”时,除非刷新页面,否则名称不会在屏幕上更改! 我怎样才能解决这个问题?
谢谢
我认为您需要为公共汽车设置手表-有关更多信息,请参见此处:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.