我在asp.net mvc 5项目中使用jquery.unobtrusive和jquery.validate库来验证客户端的用户注册.
在浏览器上我收到此错误:
Uncaught TypeError: $(...).parents(...).andSelf is not a function
at Object.parse (jquery.validate.unobtrusive.js:211)
at HTMLDocument.<anonymous> (jquery.validate.unobtrusive.js:392)
at mightThrow (jquery-3.1.1.js:3570)
at process (jquery-3.1.1.js:3638)
Run Code Online (Sandbox Code Playgroud)
我在我的项目中使用jquery 3.1.1.它似乎是版本问题.
任何想法我该如何解决?
我有位图图像:

我在该图像上绘制矩形:
Bitmap myImage = new Bitmap("path");
using (Graphics gr = Graphics.FromImage(myImage))
{
Pen pen = new Pen(Color.Black, 2);
gr.DrawRectangle(pen, 100,100, 100, 200);
}
Run Code Online (Sandbox Code Playgroud)

我想用黑色填充整个图像,矩形除外.像这样:

知道如何实现它吗?
我有这个功能:
function ddd(object) {
if (object.id !== null) {
//do something...
}
}
Run Code Online (Sandbox Code Playgroud)
但我得到这个错误:
Cannot read property 'id' of null
Run Code Online (Sandbox Code Playgroud)
如何检查对象是否具有属性并检查属性值?
我在模块中有这个配置和控制器:
(function () {
"use strict";
angular.module("dashboard", ["ui.router",
"clients",
"sites",
"regions",
"beddingTypes",
"geomindCommon",
])
.config([
"$stateProvider",
function ($stateProvider) {
$stateProvider
.state("home", {
url: "/Menu",
templateUrl: "app/dashboard/templates/dashboard.tmpl.html",
resolve: {
client: ['$window', 'dashboardService', 'config', clientMapResolver],
}
});
}
])
.controller('dashboardController', ['$scope', 'config',
function ($scope, config) {
$scope.currClientId = config.currClient.id;
}
])
function clientMapResolver($window, dashboardService, config) {
var layoutId = $window.parent.parent.parent.location.search.split('=')[1];
}
})();
Run Code Online (Sandbox Code Playgroud)
如你所见,我已经定义了config州内的决心.但决不会被触发,clientMapResolver也不会调用函数.
更新: 也许这会导致issuse:
该项目是SPA项目.仪表板是主要模块.我注意到在我的索引页面中我有这个说法:
<body ng-app="dashboard" ng-strict-di>
<div ng-controller="dashboardController">
<div class="sizeResponsive navbar navbar-green navbar-fixed-top">
<div class="container"> …Run Code Online (Sandbox Code Playgroud) 我有对象的数组.数组中的每个对象都有date属性.我试着从数组中得到最大的(最后一个)日期.
这是数组:
var sensorsData = [{
Id: 1,
MeasureDate: "2017-08-20T09:52:32"
}, {
Id: 2,
MeasureDate: "2017-08-20T09:54:35"
}, {
Id: 3,
MeasureDate: "2017-08-20T09:56:13"
}];
Run Code Online (Sandbox Code Playgroud)
而这里是从上面的数组获取最大日期的函数:
function updateLatestDate(sensorsData) {
return new Date(Math.max.apply(null, sensorsData.map(function(e) {
return new Date(e.MeasureDate);
}))).toISOString();
}
Run Code Online (Sandbox Code Playgroud)
我从updateLatestDate函数得到的结果是:
2017-08-20T06:56:13.000Z
Run Code Online (Sandbox Code Playgroud)
但它很奇怪,因为你可以看到sensorsData对象中没有任何属性没有从updateLatestDate函数返回的日期.
这是FIDDLER.
知道为什么updateLatestDate函数返回错误的结果吗?
我在我的项目中使用openlayers 2.
绘图完成后,我在地图上绘制了3种类型的特征我需要触发名为featureDrawed的函数.
她是我的代码:
drawControl = {
point: new OpenLayers.Control.DrawFeature(new OpenLayers.Layer.Vector("Point Layer"), OpenLayers.Handler.Point } }),
line: new OpenLayers.Control.DrawFeature(new OpenLayers.Layer.Vector("Line Layer"), OpenLayers.Handler.Path),
polygon: new OpenLayers.Control.DrawFeature(new OpenLayers.Layer.Vector("Polygon Layer"), OpenLayers.Handler.Polygon)
}
for (var key in drawControl) {
control = drawControl[key];
controls.push(control);
}
Run Code Online (Sandbox Code Playgroud)
这是用户选择要绘制的特征的html:
<div data-role="popup" id="popupShapes" data-theme="none" style="z-index:999">
<div data-role="collapsibleset" data-theme="b" data-content-theme="a" style="margin:0; width:250px;">
<div data-role="listview" data-inset="false">
<ul data-role="listview">
<li>
<input type="radio" name="type" value="point" id="pointToggle" />
<label for="pointToggle">draw point</label>
</li>
<li>
<input type="radio" name="type" value="line" id="lineToggle" />
<label for="lineToggle">draw line</label>
</li>
<li>
<input …Run Code Online (Sandbox Code Playgroud) 我在我的表单页面(WinForms)上使用GroupBox控件.
GroupBox包含五个控件(RadioButtons).
知道怎样才能获得GroupBox Control中控件的名称和状态?
我有以下 HTML 代码:
<div>
<p><label>Faculty <input type="text" class = "f"></label></p>
<p><label >Department<input type="text" class = "f"></label></p>
</div>Run Code Online (Sandbox Code Playgroud)
如何让文本框在不移动的情况下显示在另一个之下?
我从事mvc 5项目。
在我的每一页上,_Layout.cshtml我都有名为id="topBar"该元素的html元素。
但是我有一个名为About.cshtml的页面,我不希望该页面仅在其中显示id="topBar"所有其他html元素,_Layout.cshtml我希望它们在中正常显示About.cshtml。
任何想法如何才能达到上述描述的外观?
我有这个HTML:
<h4><span class="label label-default">1546 - some text</span></h4>
<div class="pull-left">
<button type="button" class="btn btn-primary" ng-click="list.saveItems();" ng-disabled="!list.currentItems.length || list.currentItemsStatus.id == 1">Submit</button>
<button type="button" class="btn btn-default" ng-click="list.getItems()">Reload</button>
<button type="button" class="btn btn-default" ng-disabled="true">Cancel</button>
</div>
Run Code Online (Sandbox Code Playgroud)
如何使用右侧的按钮在同一行上创建元素?
javascript ×3
.net ×2
asp.net-mvc ×2
c# ×2
css ×2
angularjs ×1
asp.net ×1
datetime ×1
gis ×1
html ×1
jquery ×1
openlayers ×1
timezone ×1
vb.net ×1
winforms ×1