我有一个Windows Azure网站.我开始这个网站是一个新的 - >计算 - >网站 - >从图库.在这里,我选择了Orchard CMS.我在Windows Azure中成功运行了该站点.我的挑战是,我想对它进行一些自定义.
如何将此代码放入我的本地Visual Studio 2012实例中,以便我可以:
我看到以下帖子:http://www.davidhayden.me/blog/installing-orchard-cms-as-an-azure-web-site.但是,这只涉及在WebMatrix中打开网站.我想跳过WebMatrix,如果可能的话直接去Visual Studio.
azure orchardcms visual-studio-2012 azure-web-sites webmatrix-2
我正在尝试使用Orchard CMS创建一个站点.首先,我从WebMatrix下载/安装了Orchard.我使用"默认"配方成功设置了一个站点.然后,我单击左侧的手风琴中的"文件"选项卡.从这里,我可以看到我项目中的所有文件.要在Visual Studio 2012中开始编辑,请单击功能区中的"Visual Studio"按钮.
进入Visual Studio后,我右键单击解决方案并选择"Rebuild Solution".解决方案开始构建,但后来我收到错误.错误说:
错误1未将对象引用设置为对象的实例.C:\ Users\username\Documents\My Web Sites\Orchard CMS2\Modules\Contrib.Cache\Contrib.Cache.csproj 1
请注意,此时我甚至没有编辑过单个文件.相反,我创建了一个基本站点并尝试在Visual Studio中打开它.我究竟做错了什么?
我有一个使用Bootstrap 3的网页.在这个页面中,我需要一个人可以回答的文本区域.答案是故事问题.故事问题出现在模态对话框中.可以在此Bootply中看到该设置.代码如下所示:
<div class="container">
<form>
<div class="form-group">
<label>Answer (<a id="showProblemLink" href="#">view problem</a>)</label>
<textarea class="form-control" rows="7"> </textarea>
</div>
</form>
<div id="problemModal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<p>
The local school wants a new playground.
The lot they can use for the playground is shaped like a rectangle.
The school has decided to let the students design the new playground.
The students have decided that they want 1/4 of the playground to be a football …Run Code Online (Sandbox Code Playgroud) 我有一个使用Bootstrap 4构建的应用程序.在这个应用程序中,我有一个Bower文件,具有以下内容:
bower.json
{
"name": "myApp",
"version": "1.0.0",
"dependencies": {
"jquery": "2.1.4",
"tether": "1.2.0",
"bootstrap": "v4.0.0-alpha.5"
},
"private": true
}
Run Code Online (Sandbox Code Playgroud)
我试图将这些文件与几个自定义JavaScript文件捆绑在一起.为了做到这一点,我有以下Gulp任务:
gulpfile.js
gulp.task('bundleJs', function() {
var jsFiles = [
'./bower_components/jquery/dist/jquery.min.js',
'./bower_components/tether/dist/tether.min.js',
'./bower_components/bootstrap/dist/js/bootstrap.min.js',
'./public/core.js',
'./public/utils.js'
];
return gulp.src(jsFiles)
.pipe(concat('bundle.js'))
.pipe(gulp.dest('./public/js'))
;
});
Run Code Online (Sandbox Code Playgroud)
然后,在我的网页中,我正在引用这样的文件:
的index.html
<script type="text/javascript" src="/public/js/bundle.js"></script>
Run Code Online (Sandbox Code Playgroud)
我的网页加载,我可以看到bundle.js已成功加载.但是,在控制台窗口中,我看到以下错误:
未捕获的错误:Bootstrap工具提示需要Tether
我相信这就是为什么我的汉堡菜单不再适用于手机.我的问题是,有没有办法将这些文件捆绑在一起?或者,我是否需要单独加载每个?
我有一个Vue.js应用程序.在这个应用程序中,我正在尝试动态地将过滤器值应用于Array对象.数组中的每个对象都有字段.我试图通过字段值过滤这些对象.每个字段可以通过多个值进行过滤.
目前,我还没有成功搞清楚如何进行这种过滤.我尝试过使用JavaScript的烘焙filter功能.但是,这总是为我返回一个空结果集.我把这个小提琴放在一起,其中包括以下代码:
new Vue({
el: '#app',
data: {
currentFilterProperty: '',
currentFilterValue: '',
cols: [
{ title: 'Name', prop:'name' },
{ title: 'Age', prop:'age' },
{ title: 'Birthday', prop:'birthday' },
],
dataFilters: [],
data: [
{ name:'Patricia Miller', age:69, birthday:'04-15-1948' },
{ name:'Bill Baggett', age:62, birthday:'05-07-1955' },
{ name:'Maxine Thies', age:21, birthday:'11-28-1995' },
{ name:'Alison Battle', age:65, birthday:'08-07-1952' },
{ name:'Dick Triplett', age:25, birthday:'08-27-1982' }
]
},
methods: {
addFilter: function() {
var f = …Run Code Online (Sandbox Code Playgroud) 我有一个C#应用程序.在这个应用程序中,我有一些看起来像这样的XML:
string xml = @"<list name=""Groceries"">
<add key=""1"" value=""Milk"" />
<add key=""2"" value=""Eggs"" />
<add key=""3"" value=""Bread"" />
</list>";
Run Code Online (Sandbox Code Playgroud)
我正在尝试将此XML转换为C#对象.我的班级看起来像这样:
public class List : ConfigurationElement, IXmlSerializable
{
[ConfigurationProperty("name", IsRequired = true, IsKey = true, DefaultValue = "")]
public string Name
{
get { return (string)(this["name"]); }
set { this["name"] = value; }
}
[ConfigurationProperty("", IsRequired = false, IsKey = false,
IsDefaultCollection=true)]
public KeyValueConfigurationCollection Items
{
get
{
var items = base["items"] as KeyValueConfigurationCollection;
return items;
}
set
{
if (base.Properties.Contains("items")) …Run Code Online (Sandbox Code Playgroud) 我继承了一个使用 OAuth 的 Node.js Web 应用程序。每当您访问页面时,应用程序都会确保您已通过身份验证。请注意,这里没有 Angular、React、Vue 等。每个页面都是直接的 HTML。
我想使用Cypress测试这个网站。我的问题是,我陷入了来自身份验证提供商的初始重定向。Cypress 承认OAuth 是一个挑战。
命令.js
Cypress.Commands.add('login', (credentials) => {
var settings = {
'clientId':'<id>',
'scope':'<scope-list>',
...
};
var body = `client_id=${settings.clientId}&scope=${settings.scope}...`;
var requestOptions = {
method: 'POST',
url: 'https://login.microsoftonline.com/...',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: body
}
cy.request(requestOptions);
});
Run Code Online (Sandbox Code Playgroud)
然后,在我的测试中,我有:
context('Home', () => {
it('Visits Successfully', () => {
cy.login();
cy.title().should('include', 'welcome');
});
});
Run Code Online (Sandbox Code Playgroud)
在测试运行程序中,我看到正在发生登录 POST 请求。我确认正在使用 接收访问令牌console.log,但是,我的标题为空。这就像 Cypress 中未发生 OAuth 之后的重定向一样。但是,当我在浏览器中访问该网站时,重定向会按预期发生。
我缺少什么?
我有一个Vue.js应用。该应用程序是一个渐进式Web应用程序,因此主要用于客户端。但是,在初始启动期间,我需要在Azure Active Directory中对用户进行身份验证,获取与他们的帐户关联的数据,并将其存储以供脱机使用。
我已经有一个服务器端API,用于检索与用户帐户关联的数据。我也知道如何存储它以供离线使用。但是,我的问题是:如何从Vue.js应用程序中的Microsoft Graph进行身份验证?我看到的一切都依赖于使用Node.js中间件,但是除非我误解了,否则我的渐进式Web应用程序不是Node.js应用程序。它只是JavaScript,HTML和CSS。
如果用户关闭该应用程序,然后在几天后重新访问它,我相信我将需要使用刷新令牌来获取新的访问令牌。再一次,我看到的一切都依赖于Node.js中间件。我相信我需要一个完全在Vue.js / JavaScript中工作的解决方案。我错了吗?
更新
1)通过NPM(npm install @microsoft/microsoft-graph-client --save)安装了Microsoft Graph Client 。这安装了v1.7.0。
2)在我的Vue.js应用中,我有:
import * as MicrosoftGraph from '@microsoft/microsoft-graph-client';
import * as Msal from 'msal';
let clientId = '<some guid>';
let scopes = ['user.read'];
let redirectUrl = 'http://localhost:1234/'; // This is registered in Azure AD.
let cb = (message, token, error, tokenType) => {
if (error) {
console.error(error);
} else {
console.log(token);
console.log(tokenType);
}
}
let reg = new Msal.UserAgentApplication(clientId, undefined, cb, { redirectUrl …Run Code Online (Sandbox Code Playgroud) 我有一个使用RIA服务的Silverlight应用程序.但是,我需要一个带有多个参数的服务操作.我的操作如下所示:
public void MyOperation(string userName, bool isActive, string emailAddress)
{
// Do Stuff
}
Run Code Online (Sandbox Code Playgroud)
就像现在一样,我得到一个错误,上面写着: 错误263域操作条目'MyOperation'必须只有一个参数.
我的问题是,如何在RIA服务服务中创建服务操作?谢谢!
我有一个 Vue 组件。这个组件非常基础,看起来像这样:
我的component.vue
<template>
<div class="foo">
</div>
</template>
<script>
export default {
data() {
return {};
},
props: {
message: {
type: String,
default: ''
}
},
methods: {
display: function() {
alert(this.message);
}
},
};
</script>
Run Code Online (Sandbox Code Playgroud)
我想使用这样的东西将它导入到一个 HTML 文件中:
<script type="text/javascript" src="/components/my-component.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
然后,我希望能够像这样在我的 HTML 文件中使用该组件:
<my-component message="hello"></my-component>
Run Code Online (Sandbox Code Playgroud)
这可能吗?如果是这样,如何?我看到的所有东西都使用 web pack 和一堆其他东西。我有一个工作组件。我只是不知道如何使它易于部署。
我创建了一个 gulpfile 来帮助解决这个问题。这看起来像这样:
gulpfile.js
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var webpack = require('webpack-stream');
gulp.task('default', ['build']);
gulp.task('build', [], function() {
return …Run Code Online (Sandbox Code Playgroud) javascript ×5
vue.js ×3
c# ×2
oauth-2.0 ×2
orchardcms ×2
azure ×1
cypress ×1
jquery ×1
ria ×1
silverlight ×1
testing ×1
wcf ×1
webmatrix-2 ×1