小编Win*_*Win的帖子

AjaxControlToolkit需要ASP.NET Ajax 4.0脚本错误

我只在生产中遇到AjaxToolkit日历显示错误.本地调试时,此问题不存在,日历日期选择器完美运行.所有其他帖子围绕此工具包不起作用.我担心为什么这在测试中有效但不能生成,因为我在使用ASP.NET ScriptManager的代码中的任何地方都找不到引用.

以下是"Site.Master"

<ajaxToolKit:ToolkitScriptManager runat="server">
    <Scripts>
        <%--Framework Scripts--%>            
        <%--<asp:ScriptReference Name="jquery" />--%>
        <%--<asp:ScriptReference Name="jquery.ui.combined" />--%>
        <asp:ScriptReference Path="~/Scripts/WebForms/WebForms.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/WebUIValidation.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/MenuStandards.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/GridView.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/DetailsView.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/TreeView.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/WebParts.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/Focus.js" />
        <asp:ScriptReference Name="WebFormsBundle" />
        <%--Site Scripts--%>

    </Scripts>
</ajaxToolKit:ToolkitScriptManager>
Run Code Online (Sandbox Code Playgroud)

这是使用日历功能并将Site.Master作为其MasterPageFile的页面

<asp:Label ID="DateRangeLabel" runat ="server" Text="Date Range: "></asp:Label>
<asp:TextBox ID="DateFrom" runat="server" Width="95px"></asp:TextBox>
<ajaxtoolkit:calendarextender ID="Calendarextender" runat="server" TargetControlID="DateFrom" PopupPosition="BottomLeft" Format="MM/dd/yyyy"></ajaxtoolkit:calendarextender>
<asp:TextBox ID="DateTo" runat="server" Width="95px"></asp:TextBox>
<ajaxtoolkit:calendarextender ID="Calendarextender1" runat="server" TargetControlID="DateTo" PopupPosition="BottomLeft" Format="MM/dd/yyyy"></ajaxtoolkit:calendarextender>
Run Code Online (Sandbox Code Playgroud)

这是我的Web.config文件的一部分

<controls>
    <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" /> …
Run Code Online (Sandbox Code Playgroud)

asp.net ajax scriptmanager ajaxcontroltoolkit

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

User.IsInRole与AuthenticateRequest中的Roles.IsUserInRole

HttpContext.Current.User.IsInRole 在AuthenticateRequest中不可用; 但是,Roles.IsUserInRole可用.

是因为在AuthenticateRequest之后将新的GenericPrincipal分配给HttpContext.Current.User?有人可以解释一下吗?感谢您的帮助!

void Application_AuthenticateRequest(object sender, EventArgs e)
{
    if(HttpContext.Current.Request.IsAuthenticated)
    {
        // Return False
        bool result1 = HttpContext.Current.User.IsInRole("Administrators");

        // Return True
        bool result2 = Roles.IsUserInRole("Administrators");
    }
}
Run Code Online (Sandbox Code Playgroud)

membership asp.net-membership roleprovider membership-provider

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

ASP.Net Web API是.Net和PHP消耗的API的不错选择吗?

在过去,我使用ASMX,它通过SOAP WSDL提供强类型类.

我必须实现将由.Net和PHP使用的API.所以我已经决定使用REST(我对Azure的Rest API(如Blob存储)印象非常深刻).

虽然我读了几本书 - Pro ASP.NET MVC 4,API,Pro ASP.NET Web API Security,但我对Web API还是很陌生.但是,我仍然无法弄清楚以下几点 -

问题

  1. 客户端是否可以从Web API(如SOAP WSDL)获取强类型类?(如果没有,我需要做什么才能获得像Azure Blob存储这样的强类型类)

  2. PHP客户端可以轻松使用Web API吗?(我对PHP一无所知)

谢谢你脱光!

请注意,这不是关于SOAP vs Rest,Web API与WCF的争论.

php c# asp.net rest asp.net-web-api

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

错误代码:12114无效的项目URL.由于参数无效,交易被拒绝

我们在ASP.Net应用程序中使用PayPal Express(以及其他网关).它工作正常,我们甚至今天早上通过PayPal Express成功收到订单.

但是,我们的一位客户在退房时收到以下错误消息 -

无效的项目URL.由于参数无效,交易被拒绝.错误代码:12114

不幸的是,我在API错误和警告代码中找不到12114错误代码

我想知道除了陈述的内容之外可能导致错误的原因.

c# asp.net paypal

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

如何在Visual Studio社区2013中创建ASP.NET MVC 5 Web应用程序?

我正在尝试在安装Visual Studio Community 2013的全新安装后启动MVC 5项目,但是当我去的时候

新建项目>模板> Visual C#> Web> Version2012

我在中间窗格中看到的只是ASP.NET MVC 4 Web应用程序.有没有人有任何想法为什么我没有ASP.NET MVC 5 Web应用程序?

我选择了.NET Framework 4.5.1.

c# asp.net asp.net-mvc

5
推荐指数
2
解决办法
3166
查看次数

如何仅在jVectorMap中单击某个区域时显示工具提示,并让它打开?

我正在使用这个jVectorMap.默认情况下,它会在悬停时显示工具提示.

这是我想要实现的目标 -

  1. 在单击时 显示工具提示(部分工作但工具提示应该在鼠标光标上方.我无法弄清楚如何获得鼠标光标位置.)
  2. 让工具提示打开,直到用户明确点击关闭.

代码:jsfiddle

$('#map').vectorMap({
    map: "us_aea_en",
    backgroundColor: "transparent",
    regionStyle: {
        initial: {
            fill: "#818486"
        }
    },
    onRegionClick: function (e, code) {
        var map = $('#map').vectorMap('get', 'mapObject');        
        map.tip.show();
        map.tip.html(code + "<p>Click to Close</p>");
    },
    onRegionTipShow: function (e, tip, code) {
        e.preventDefault();
    }
});
Run Code Online (Sandbox Code Playgroud)

欲望行为

在此输入图像描述

javascript jquery jvectormap

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

Angular 1.5组件中的Angular Bootstrap Modal $ uibModalInstance未知提供程序

当我尝试在Angular 1.5组件中关闭A ngular Bootstrap Modal时,它会抛出错误:$ injector:unpr Unknown Provider.

如果我使用Controller而不是Component,它工作正常.我错过了什么吗?

在Plunker演示

<!doctype html>
<html ng-app="app">
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-animate.js"></script>
    <script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-1.3.2.js"></script>
    <script src="example.js"></script>
    <link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <h1>Angular Modal Demo</h1>
    <my-content></my-content>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

脚本

angular.module('app', ['ngAnimate', 'ui.bootstrap']);

angular.module('app')
  .component('myContent', {
      template: 'I am content! <button type="button" class="btn btn-default" ng-click="$ctrl.open()">Open Modal</button>',
      controller: function ($uibModal) {
          this.open = function () {
              $uibModal.open({
                  template: '<my-modal></my-modal>'
              });
          };
      }
  });

angular.module('app')
  .component('myModal', {
      template: '<div class="modal-body">I …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angular-ui-bootstrap

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

使用.NET Core和Angular 2/4的Web App的基础层

您好我正在寻找使用yeoman应用程序生成器或最少量代码模板的指令来创建集成Entity Framework Core和Angular 2/4的Web应用程序.

优选地,所提供的答案将使用yeoman应用程序生成器.另外,我不介意安装任何其他必要的工具来实现这一目标.

asp.net yeoman

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

删除Azure Active Directory会返回尽管没有应用程序,但删除所有应用程序注册

我正在尝试删除Azure中的Active Directory (非默认)。它说我需要删除所有App注册。当我单击链接时,没有注册的应用程序。

有趣的是仪表板说我已经注册了1个应用程序。当我单击链接时,也没有任何应用程序。

在此处输入图片说明

在此处输入图片说明

azure azure-active-directory

5
推荐指数
2
解决办法
1012
查看次数

Azure Web App 无法从 smtp.office365.com 发送电子邮件

我正在尝试使用 Office365 从 Azure Web App 发送电子邮件。稍后,我们会将其移动到 Azure Web Job 或 Azure Functions。

以下示例代码适用于本地开发计算机,以及在同一端口 587 上使用本地 SMTP 服务器的Azure 中。但是,与本地计算机相同的凭据会从 Azure 中的smtp.office365.com引发异常。

问题似乎出在 Azure 和 Office 365 之间。任何帮助将不胜感激!

使用 O365 SMTP 服务器从 Azure 应用服务发送电子邮件

MailMessage msg = new MailMessage();
msg.To.Add(new MailAddress("To Email Address", "Benjamin"));
msg.From = new MailAddress("From Email Address", "You");
msg.Subject = "Azure Web App Email using smtp.office365.com";
msg.Body = "Test message using smtp.office365.com on Azure from a Web App";
msg.IsBodyHtml = true; …
Run Code Online (Sandbox Code Playgroud)

c# asp.net smtp azure office365

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