小编Kri*_*ppa的帖子

控制器:ctrlfmt 格式错误的控制器字符串 ''。必须匹配 `__name__ 作为 __id__` 或 `__name__`

在 rootes.js 中

.state('main.mydata', {
    url: '/my-data',
    templateUrl: '/app/views/pages/my-data.html',
    controller: 'mydataCtrl'
})
Run Code Online (Sandbox Code Playgroud)

控制器

.controller('mydataCtrl', ['$scope', '$state', '$http', function($scope, $state, $http) {
    console.log("Came to My Data")
}])
Run Code Online (Sandbox Code Playgroud)

当我调用页面在控制台中出错时

Error: angular.js?bundleVirtualPath=~%2fbundles%2fangular:13708 [$controller:ctrlfmt] Badly formed controller string ''. Must match `__name__ as __id__` or `__name__`.
http://errors.angularjs.org/1.5.7/$controller/ctrlfmt?p0=
    at http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7eNaNbundles%fangular:68:12
    at $controller (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:10199:17)
    at setupControllers (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:9331:34)
    at nodeLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:9116:32)
    at compositeLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:8510:13)
    at nodeLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:9210:24)
    at compositeLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:8510:13)
    at compositeLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:8513:13)
    at compositeLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:8513:13)
    at publicLinkFn (http://localhost:25282/Scripts/angular.js?bundleVirtualPath=%7e%fbundles%fangular:8390:30)
Run Code Online (Sandbox Code Playgroud)

可能是什么问题?

angularjs

5
推荐指数
1
解决办法
3320
查看次数

如何在网格视图的RowCommand方法中找到标签控件?

GridViewRow clickedRow = ((LinkButton)sender).NamingContainer as GridViewRow;
Label lblUser = clickedRow.FindControl("lblFullName") as Label;
Label lblUserId = (Label)clickedRow.FindControl("lblUserId");
Run Code Online (Sandbox Code Playgroud)

编译器抛出错误为

无法转换类型为“System.Web.UI.WebControls.GridView”的对象

c# asp.net gridview

2
推荐指数
1
解决办法
3370
查看次数

标签 统计

angularjs ×1

asp.net ×1

c# ×1

gridview ×1