- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这个旧标题描述了可见的问题,但新标题更好地描述了根本原因问题。我仍然不确定为什么 ASHX 没有被调用,所以我仍在寻找答案。我现在通过硬编码 API 描述符(Ext.app.REMOTING_API 变量)有一个解决方法。我从运行 .NET 3.5 的原始代码中,从 DirectProxy“provider”返回的变量中得到了那个 JSON 对象(Ext.app.REMOTING_API 变量)。我只是使用了一个在线 JavaScript 美化器让它看起来很漂亮(这样你就可以阅读它,而不是在一行上)。
旧标题:ExtJS 3 Ext.Direct proxy error: Uncaught TypeError: Cannot read property 'events' of undefined
我刚刚将 extdirect4dotnet 项目从 .NET 3.5 升级到 .NET 4.0。可以在此处找到该项目和示例项目 https://code.google.com/p/extdirect4dotnet/ .当我这样做时,我不得不在更改项目版本时临时复制 Web.Config 文件。我修复了由于继承 JSON.NET 中的类而导致的两个覆盖方法的参数列表,该类位于 http://json.codeplex.com/SourceControl/latest#readme.txt .我还修复了两个项目中 DLL 引用的方式。然后我将 Web.Config 中所有出现的“3.5”替换为“4.0”。
不幸的是,该项目使用 ExtJs 3.0.0,而不是 ExtJs 4.2.*,这是我正在使用此 .NET 服务器端堆栈 (extdirect4dotnet) 实现 Ext.Direct 代理的框架版本。所以它仍然使用一些旧的语法。下面我试图找出在 .NET 升级后如何修复特定错误。它仍在使用 ExtJs 3.0.0。请参阅“addProvider”函数中的“see this line”以查看它失败的行。当我从 JavaScript 调试它时,“provider”是未定义的。我猜它不知道如何获取提供者 Ext.app.REMOTING_API
在我将其升级到 .NET 4.0 之后。
JavaScript 错误:
Uncaught TypeError: Cannot read property 'events' of undefined
/*!
* Ext JS Library 3.0.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
*/
* </code></pre>
* @param {Object/Array} provider Accepts either an Array of Provider descriptions (an instance
* or config object for a Provider) or any number of Provider descriptions as arguments. Each
* Provider description instructs Ext.Direct how to create client-side stub methods.
*/
addProvider : function(provider){
var a = arguments;
if(a.length > 1){
for(var i = 0, len = a.length; i < len; i++){
this.addProvider(a[i]);
}
return;
}
// if provider has not already been instantiated
if(!provider.events){ // <========================= see this line
provider = new Ext.Direct.PROVIDERS[provider.type](provider);
}
provider.id = provider.id || Ext.id();
this.providers[provider.id] = provider;
provider.on('data', this.onProviderData, this);
provider.on('exception', this.onProviderException, this);
if(!provider.isConnected()){
provider.connect();
}
return provider;
},
Ext.Direct.addProvider(Ext.app.REMOTING_API);
Ext.onReady(function () {
Ext.app.REMOTING_API = {
"type": "remoting",
"id": "1",
"url": "../directRouter.ashx",
"actions": {
"CallTypes": [{
"name": "Echo",
"len": 1,
"formHandler": false
}, {
"name": "GetTime",
"len": 0,
"formHandler": false
}, {
"name": "UploadHttpRequestParam",
"len": 1,
"formHandler": true
}, {
"name": "UploadNamedParameter",
"len": 1,
"formHandler": true
}, {
"name": "SaveMethod",
"len": 3,
"formHandler": false
}, {
"name": "SaveMethod_Form",
"len": 1,
"formHandler": true
}, {
"name": "DateSample",
"len": 2,
"formHandler": false
}],
"TreeAction": [{
"name": "getChildNodes",
"len": 2,
"formHandler": false
}],
"CRUDSampleMethods": [{
"name": "create",
"len": 1,
"formHandler": false
}, {
"name": "read",
"len": 1,
"formHandler": false
}, {
"name": "update",
"len": 2,
"formHandler": false
}, {
"name": "destroy",
"len": 1,
"formHandler": false
}, {
"name": "reset",
"len": 0,
"formHandler": false
}]
}
};
Ext.Direct.addProvider(Ext.app.REMOTING_API);
//Ext.Direct.addProvider();
var Employee = Ext.data.Record.create([
{ name: 'firstname' }, // map the Record's "firstname" field to the row object's key of the same name
{name: 'job', mapping: 'occupation'} // map the Record's "job" field to the row object's "occupation" key
]);
var reader = new Ext.data.JsonReader({
totalProperty: 'results',
successProperty: 'success',
idProperty: 'id',
root: 'data'
}, [
{ name: 'id' },
{ name: 'email', allowBlank: false },
{ name: 'first', allowBlank: false },
{ name: 'last', allowBlank: false }
]
);
var writer = new Ext.data.JsonWriter({
returnJson: false,
writeAllFields: true
});
var store = new Ext.data.DirectStore({
api: {
read: CRUDSampleMethods.read,
create: CRUDSampleMethods.create,
update: CRUDSampleMethods.update,
destroy: CRUDSampleMethods.destroy
},
reader: reader,
baseParams: { dummy: 'blubb' },
writer: writer, // <-- plug a DataWriter into the store just as you would a Reader
paramsAsHash: true,
batchSave: false,
batch: false,
prettyUrls: false,
remoteSort: true,
listeners: {
load: function (result) {
},
loadexception: function () {
},
scope: this
}
});
//
var myPageSize = 10;
var userColumns = [
{ header: "ID", width: 40, sortable: true, dataIndex: 'id' },
{ header: "Email", width: 100, sortable: true, dataIndex: 'email', editor: new Ext.form.TextField({}) },
{ header: "First", width: 50, sortable: true, dataIndex: 'first', editor: new Ext.form.TextField({}) },
{ header: "Last", width: 50, sortable: true, dataIndex: 'last', editor: new Ext.form.TextField({}) }
];
Ext.onReady(function () {
Ext.QuickTips.init();
var userForm = new App.user.Form({
renderTo: 'user-form',
listeners: {
create: function (fpanel, data) { // <-- custom "create" event defined in App.user.Form class
var rec = new userGrid.store.recordType(data);
userGrid.store.insert(0, rec);
}
}
});
// create user.Grid instance (@see UserGrid.js)
var userGrid = new App.user.Grid({
renderTo: 'user-grid',
store: store,
columns: userColumns,
bbar: new Ext.PagingToolbar({
store: store, // grid and PagingToolbar using same store
displayInfo: true,
pageSize: myPageSize,
prependButtons: true,
items: [
'text 1'
]
}),
listeners: {
rowclick: function (g, index, ev) {
var rec = g.store.getAt(index);
userForm.loadRecord(rec);
},
destroy: function () {
userForm.getForm().reset();
}
}
});
setTimeout(function () {
Ext.get('loading').remove();
Ext.fly('loading-mask').fadeOut({
remove: true
});
store.load({ params: {
start: 0, // specify params for the first page load if using paging
limit: myPageSize,
foo: 'bar'
}
});
}, 250);
});
}); // onready
<link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-all.css" />
<script type="text/javascript" src="../ext/ext-base-debug.js"></script>
<script type="text/javascript" src="../ext/ext-all-debug.js"></script>
<!-- directProxy.rfc was registred in the web.config -->
<script type="text/javascript" src="../directProxy.ashx"></script>
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using ExtDirect4DotNet;
namespace WebApplication1
{
/// <summary>
/// Zusammenfassungsbeschreibung für $codebehindclassname$
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class directProxy : DirectProxy
{
public directProxy()
{
DirectProxy.routerUrl = "../directRouter.ashx";
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Configuration;
using System.Web.Configuration;
using ExtDirect4DotNet;
using ExtDirect4DotNet.helper;
namespace ExtDirect4DotNet
{
/// <summary>
/// Represents the Proxy For Ext.Direct Comunication.
/// Tha ProccessRequest Methode scanns all the available Assembly for Classes and Methods with the
/// Direct Attribute.
/// </summary>
public class DirectProxy : IHttpHandler
{
private static string url = "";
public static string routerUrl {
get { return url; }
set { url = value; }
}
public static DirectProvider getDirectProviderCache(string apiNameSpace)
{
string routerUrl = (DirectProxy.routerUrl == "") ? ConfigurationCache.getRouterUrl() : DirectProxy.routerUrl;
// set default namspace for the remoting API
string apiNamespace = (apiNameSpace == null || apiNameSpace == "") ? "Ext.app.REMOTING_API" : apiNameSpace;
DirectProviderCache cache = DirectProviderCache.GetInstance();
DirectProvider provider;
//After being configured, the provider should be cached.
if (!cache.ContainsKey(apiNamespace + "/" + routerUrl))
{
provider = new DirectProvider(apiNamespace, routerUrl);
provider.Configure(AppDomain.CurrentDomain.GetAssemblies());
if (!cache.ContainsKey(apiNamespace + "/" + routerUrl))
cache.Add(apiNamespace + "/" + routerUrl, provider);
}
else
{
provider = cache[apiNamespace + "/" + routerUrl];
}
return provider;
}
public void ProcessRequest(HttpContext context)
{
// set default namspace for the remoting API
string apiNamespace = "Ext.app.REMOTING_API";
if (context.Request.Form["ns"] != null)
{
// if there is an namespace parameter, use it...
apiNamespace = context.Request.Form["ns"].ToString();
}
DirectProvider provider = getDirectProviderCache(apiNamespace);
context.Response.Write(provider.ToString());
/*
old code..
// set the Response typ to javascript since the responce gets Parsed into an Script Tag
context.Response.ContentType = "text/JavaScript";
string rem = "{";
rem += "url: \""+routerUrl+"\",";
rem += "type:\"remoting\",";
//string json = DirectProxyGenerator.generateDirectApi();
//rem += json;
rem += "};";
rem = apiNamespace + ".REMOTING_API =" + rem;
rem = "(function(){" + rem + "})();";
context.Response.Write(rem);
*/
}
public bool IsReusable
{
get { return false; }
}
}
}
最佳答案
在 IIS 7 中重现问题后,最终为 IIS 6 和 IIS 7 解决了这个问题!!
HTTP 处理程序在带有 .NET 3.5 和 .NET 4.0 的 IIS 6 上工作。但是,当您将框架升级到 .NET 4.0 时,IIS 7 上的 HTTP 处理程序会中断。为了修复,您必须做 4 件事。
1.) 将应用程序池 .NET 版本从 v2.0 更改为 v4.0
2.) 将应用程序池从集成更改为经典
3.) 将应用程序池从 64 位更改为 32 位
4.) 替换 Web.Config 中的 XML 标记。如果不这样做并且将这些行的“3.5.0.0”版本替换为“4.0.0.0”,则可能会损坏 IIS 并引发此错误。
Configuration file is not well-formed XML #2
.NET 3.5 版 Web.Config 配置:
(注意“PublicKeyToken”属性值中的小写字母与大写字母)
<!--<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>-->
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
关于ASP.NET 通用处理程序在 .NET 3.5 到 .NET 4.0 升级后未被调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17779128/
我几乎不敢在这里问这个问题,因为它似乎应该很容易通过谷歌或 ravendb.net 获得。但是,我一直很难找到将我的 RavenDB 升级到新版本的正确方法。我目前正在运行 573 版并希望升级到 6
这周我需要升级当前版本的 DNN。我目前使用的是 2.1.1。我不想每件事都做两次,所以,我有几个问题。 是否有升级工具或某些脚本可以帮助我进行升级。 我最好安装 4.9 还是 5.0。这是生产。 如
将 Sugarcrm 从 6.2 升级到 6.3 版本时遇到问题。当我升级本地 Sugarcrm 安装时,它可以工作,但是当我开始升级我的 Sugarcrm 6.2 站点并上传升级包时,它不会上传。
有没有办法绕过 Meteor 的自动更新功能?我坚持 Downloading meteor-tool@1.3.0_3... \ 当我尝试运行现有项目,或创建一个新项目或只是运行“
我已将应用内集成到我的 Andorid 应用程序中,用于单个产品 productone。 为此,我在我的 Google Play 控制台中创建了不同的产品 ID,如下所示: 1。 productone
我在将 TeamCity 版本 2017.1.1 升级到 2017.1.2 时遇到问题。这个问题涉及 TeamCity 和 PostgreSQL 的工作。我的工作: 停止 teamcity 进程 /e
我寻找了这个问题的具体答案,但找不到——即使是在 WAMPSERVER 网站上也是如此。我确定我忽略了它。 我有 Wampserver 2.0、MySQL 5.0.51b、PHP 5.2.6 和 Ap
我使用 Ubuntu 软件中心默认的 Eclipse 3.7。 我想将 Eclipse 升级到 kepler 版本,所以我添加了 repository 我收到以下错误消息: Cannot comple
你好 我只想安装 mercurial,但对于它需要 python 2.6 的所有版本,我尝试使用 .rpm 文件,但我唯一得到的是很多充满错误的行,它告诉我:需要安装在 2.6 之前和 2.5 之后的
我完全知道 Gradle 网站上有一些页面说明了如何升级,但仅限于 4.x 及更高版本。 我正在尝试关注 tutorial制作一个简单的“我的第一个”Minecraft 模组。在其中,您被告知安装 f
我们想升级 Kerberos(服务器和客户端) 当前:1.6.3-133.27.1 目标:1.6.3-133.49.97.1 问题是如果我们用包管理器升级它,下面会发生什么? KDC 数据库 所有主要
背景 原计划 2019 年发布的 Vue3,又经过一年的再次打磨,终于于去年 9 月正式发布。随后,不少 UI 组件库都积极参与适配,去年 12 月,Element-plus(
我有一个版本为 2.3.4 的 grails 项目,我需要尽可能升级到最新版本。查看文档我意识到从 2.x 到 3.x 有巨大的变化。 问题是:从 2 到 3、从 3 到 4、从 4 到 5 逐步升级
我正在将 API 项目从 .net5 升级到 .net6 它以前工作,现在它崩溃 内部异常消息“抛出了‘Unity.Exceptions.InvalidRegistrationException’类型
我将我的项目从 expo 44 升级到 expo 45,现在我有无数这样的错误: The module 'MaterialIcons' can't be used as JSX component.
我已经升级了掌 Helm 模板(手动) 以前的片段depoloyment.yaml : apiVersion: apps/v1beta2 kind: Deployment metadata: na
我正在尝试将我的 Scala Play Framework 应用程序升级到 2.8,这涉及将 SBT 升级到 1.x。 在我的 build.propeties 我有 sbt.version=1.3.5
我想在我的 Windows 服务器上安装 PHPUnit 3.7。我遵循了各种说明 here并以 PHPUnit 3.4.1 结束。当我尝试使用以下方法再次安装它时: pear update chan
Microsoft.Net 4.5 即将推出,我想在 MS 发布最终版本时升级我的 clickonce 应用程序。 我的问题是:已经安装了 clickonce 应用程序(使用 .net 4.0)的用户
为了将 Angular 8 更新到 9,我正在按照官方文档升级。 这建议首先更新到最新版本的 angular 8,例如: ng update @angular/core@8 @angular/cli@
我是一名优秀的程序员,十分优秀!