当我以http:// localhost:26049访问该站点时,该站点运行正常.如果我尝试使用https:// localhost:44319访问该站点,则会找不到页面.
这是我的项目属性:
这是来自我的IISExpress应用程序配置:
<site name="MVC Authentication" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="F:\Projects\MySite\Test" />
</application>
<bindings>
<binding protocol="https" bindingInformation="*:44319:localhost" />
<binding protocol="http" bindingInformation="*:26049:localhost" />
</bindings>
</site>
Run Code Online (Sandbox Code Playgroud) 从http重定向到https时,我不确定哪个网站最适合我的网站使用.目前我正在使用IIS重写规则来进行重定向.我读过关于如何使用301或303的指南.在阅读301和303之后,我仍然不确定哪个最好用.
我的理解是它们与http和https之间的重定向非常相似.
有什么区别,它会以任何方式影响搜索引擎优化吗?
从规格:301
301(永久移动)状态代码表示已为目标
资源分配了新的永久URI,并且
此资源的任何将来引用都应使用其中一个附带的URI.
具有链接编辑功能的客户端应尽可能自动将对有效请求URI的引用重新链接到
服务器发送的一个或多个新引用.服务器应该在响应中生成一个Location头字段,其中包含新永久URI的首选URI引用.该
用户代理可以使用自动位置字段值
重定向.服务器的响应有效负载通常包含一个短
超文本注释,其中包含指向新URI的超链接.Run Code Online (Sandbox Code Playgroud)Note: For historical reasons, a user agent MAY change the request method from POST to GET for the subsequent request. If this behavior is undesired, the 307 (Temporary Redirect) status code can be used instead.
默认情况下,301响应可缓存; 即,除非
方法定义或显式高速缓存控制另有指示
303
303(请参阅其他)状态代码表示服务器正在
将用户代理重定向到其他资源,如Location头字段中的URI所示,该URI旨在提供
对原始请求的间接响应.用户代理可以执行
针对该URI的检索请求(如果
使用HTTP 则为GET或HEAD请求),其也可以被重定向,并将最终结果作为原始请求的答案呈现.请注意,
Location头字段中的新URI 不被视为等效于
有效请求URI.此状态代码适用于任何HTTP方法.它主要用于允许输出POST操作以将用户代理重定向
到选定的资源,因为这样做
可以单独
识别,添加书签和缓存的形式提供与POST响应相对应的信息,而与原始
要求.对GET请求的303响应指示源服务器不具有
可由服务器通过HTTP传送的目标资源的表示.但是,"位置"字段
值是指描述目标
资源的资源,因此对该其他资源发出检索请求可能会导致对收件人有用的表示,而不会暗示它表示原始目标资源.请注意,
对可以表示的内容,什么
表示形式以及可能有用的描述的问题的答案
超出了HTTP的范围.除了对HEAD请求的响应之外,303响应的表示应该包含一个短的超文本注释,其中包含指向
Location头字段中提供的相同URI引用的超链接.
当我在发布模式下从Visual Studio运行我的代码,并检查捆绑的样式表时,我可以看到我对该包中的css文件的更新.但是,当我将网站发布到服务器或本地计算机时,样式表中的更改尚未通过.捆绑的样式表仍然是旧样式表.
我尝试过IIS重置,干净的构建/重建,从IIS文件夹中删除所有文件并重新发布.
如果这有任何不同,我使用的是LESS.
我的包配置:
bundles.Add(new StyleBundle("~/bundles/requiredStyles").Include(
"~/Content/Style/Libs/bootstrap.min.css",
"~/Content/Style/Libs/font-awesome.min.css",
"~/Content/Style/Globals/application.css",
"/Content/Style/Libs/muliDropdown.css",
"~/Content/Style/Libs/smoothDivScroll.min.css",
"~/Content/Style/Libs/jasny-bootstrap.min.css"
));
Run Code Online (Sandbox Code Playgroud)
我正在访问http://www.mywebsite.com/bundles/requiredStyles来查看捆绑的CSS
所以我在application.css上做了一个更改,如果我在visual studio中播放(在发布模式下),这很好,但是当我发布到我的本地IIS时,我的更改不再存在.
$ scope.testing正在作为按钮Id正确添加,但单击该按钮不会触发警报.
请参阅示例 - http://plnkr.co/edit/RtidzgiUI7ZAMOTu3XHy?p=preview
CONTROLLER
var app = angular.module('StockCategory', []);
app.controller('stockCategoryController', function($scope) {
$scope.testing = 'World';
$scope.saveCategory = function() {
alert('hello');
}
});
Run Code Online (Sandbox Code Playgroud)
HTML
<div class="stock-categories" ng-app="StockCategory" ng-controller="stockCategoryController">
<button class="btn save-cat" id="{{testing}}" ng-click="saveCategory();">Save</button>
</div>
Run Code Online (Sandbox Code Playgroud) 我无法让我的表单在我的控制器上调用POST操作.
我的页面代码
@model My.Models.ManageUserViewModel
@using (Html.BeginForm("Manage", "Account", FormMethod.Post, new { @id = "manageAccountFormHolder", @class = "form-horizontal col-sm-8 col-sm-offset-2 v-offset-4" }))
{
@Html.AntiForgeryToken()
<h4 class="text-center">Change Password</h4>
<div class="form-group">
@Html.LabelFor(m => m.OldPassword, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.PasswordFor(m => m.OldPassword, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.NewPassword, new { @class = "col-sm-3 control-label" })
<div class="col-sm-9">
@Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.ConfirmPassword, …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用带有Angular的jQuery花式树插件.树的源数据来自我的控制器中的ajax调用.我然后尝试将该数据导入我的指令并加载树.假设该服务需要2秒钟来获取数据.这是我的代码的缩减版本.
HTML
<div tree-view ></div>
Run Code Online (Sandbox Code Playgroud)
服务
angular.module('sc.services', []).
factory('scService', function ($http) {
var scApi = {};
scApi.getsc = function () {
return $http({
url: config.Url.sc
});
};
return scApi;
});
Run Code Online (Sandbox Code Playgroud)
CONTROLLER
angular.module('sc.controllers', []).
controller('scController', function ($scope, scService) {
scService.getsc().success(function (response) {
$scope.sc = response;
});
});
Run Code Online (Sandbox Code Playgroud)
指示
angular.module('sc.directives', [])
.directive('treeView',function () {
return {
restrict: 'A',
link: function (scope, element, attrs) {
scope.$watch('sc', function() {
$(element).fancytree({
source: scope.sc
});
});
}
}
});
Run Code Online (Sandbox Code Playgroud)
Jquery将奇特的树加载到页面上(因此调用了指令)但没有数据.我还将数据绑定到页面上的表,以确保其加载正常并且可行.我错过了什么?
这是正确的方法吗?
我的webjob从我的blob存储中删除文档.如果我将代码复制到控制台应用程序并运行它,它将运行完成而不会出现错误.如果我在visual studio中创建一个新的webjob(右键单击我的网站项目并选择Add - > New Azure Webjob project),将代码复制到Functions.cs并进行部署,Azure在运行webjob时抛出异常:
===============================================
[09/09/2016 01:51:44 > fc93a9: ERR ] Unhandled Exception: Microsoft.WindowsAzure.Storage.StorageException: The remote name could not be resolved: 'xxx.queue.core.windows.net' ---> System.Net.WebException: The remote name could not be resolved: 'xxx.queue.core.windows.net'
[09/09/2016 01:51:44 > fc93a9: ERR ] at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
[09/09/2016 01:51:44 > fc93a9: ERR ] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse[T](IAsyncResult getResponseResult)
[09/09/2016 01:51:44 > fc93a9: ERR ] --- End of inner exception stack trace ---
[09/09/2016 01:51:44 > fc93a9: ERR ] at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result)
[09/09/2016 01:51:44 > …
Run Code Online (Sandbox Code Playgroud) 我们目前在 Azure 的 SQL Server 上托管了大约 400 个客户端数据库。最初设置时,没有设置 Active Directory 管理员用户,只有一个服务器管理员,目前所有连接字符串都使用此服务器管理员。如果我向服务器添加 Active Directory 管理员,这会对使用服务器管理员的任何数据库的连接产生任何影响吗?换句话说,服务器管理员是否仍然可以正常工作并且添加 Active Directory 管理员不会断开当前连接到 SQL 服务器的任何用户的连接?
来自https://docs.mongodb.com/manual/reference/operator/update/positional-filtered/#up。S [%3C标识符%3E]
给定以下集合
{
"_id" : 1,
"grades" : [
{ "grade" : 80, "mean" : 75, "std" : 6 },
{ "grade" : 85, "mean" : 90, "std" : 4 },
{ "grade" : 85, "mean" : 85, "std" : 6 }
]
}
{
"_id" : 2,
"grades" : [
{ "grade" : 90, "mean" : 75, "std" : 6 },
{ "grade" : 87, "mean" : 90, "std" : 3 },
{ "grade" : 85, …
Run Code Online (Sandbox Code Playgroud) 我正在使用Microsoft.AspNetCore.SignalR.Client
从WebAPI项目打开的连接来连接和调用SignalR Hub项目中的方法。这些是托管在单独服务器上的单独项目。
如何检查连接是否已启动,所以我不会尝试两次启动?
我使用以下代码从WebAPI连接:
public class ChatApi
{
private readonly HubConnection _connection;
public ChatApi()
{
var connection = new HubConnectionBuilder();
_connection = connection.WithUrl("https://localhost:44302/chathub").Build();
}
public async Task SendMessage(Msg Model)
{
await _connection.StartAsync();
await _connection.SendAsync("Send", model);
}
}
Run Code Online (Sandbox Code Playgroud)
由于我的WebAPI将大量调用SignalR,因此我想在WebAPI和SignalR之间创建单个连接,而不是每次都关闭/打开该连接。此刻,我将ChatApi
类创建为单例,并在构造函数中初始化集线器连接。
在致电之前,我如何检查连接是否已启动await _connection.StartAsync();
?
使用:Microsoft.AspNetCore.SignalR.Client
v1.0.0-preview1-final
c# connection signalr.client asp.net-core asp.net-core-signalr
c# ×5
.net ×2
angularjs ×2
azure ×2
javascript ×2
ajax ×1
asp.net ×1
asp.net-core ×1
asp.net-mvc ×1
connection ×1
css ×1
http ×1
https ×1
iis-express ×1
jquery ×1
mongodb ×1
publishing ×1
razor ×1
redirect ×1
rewrite ×1
seo ×1
sql-server ×1
ssl ×1