2.0运行时javascript错误 - WebForm_PostBackOptions未定义 [英] 2.0 runtime javascript error - WebForm_PostBackOptions is undefine

查看:46
本文介绍了2.0运行时javascript错误 - WebForm_PostBackOptions未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将我的企业解决方案从VS 2003(.NET v1.1.4322)转换为VS

2005(.NET v2.0.50727)。整个解决方案使用了多种技术 -

Windows Server 2003(AD,SQL Server 2000,IIS,ASP.NET,ASP.NET Mobile)

Windows Mobile 2003(Pocket IE )


我已经完成了部分转换(PIE的ASP.NET移动页面,

和一些基于ASP.NET的Web服务) ,并且测试时我有一个运行时错误在1.1版本中不存在。

它与Windows Mobile ObjectList(mobile:ObjectList)相关联>
在IE 6.0桌面上进行调试时(我已经*尚未开始转换
使用PDA上的PIE测试
),我点击了对象列表中的链接按钮/>
现在收到一个JavaScript错误 -

WebForm_PostBackOptions未定义。


我在代码中没有显式使用Javascript,导致错误通过

ASP.NET 2.0生成的Javascript。

ObjectList中LinkBut​​tons的我的.aspx代码看起来像 -

(< asp: LinkBu tton ID =" lbnTask"的CommandName = QUOT;细节" Runat =" server"><%#

((ObjectListItem)Container)[" name"]%>< / asp:LinkBut​​ton>)

>
ASP.NET 2.0为浏览器生成javascript -

< TD>< a id =" olstTask__ctl1_lbnTask"

href =" ; javascript :WebForm_DoPostBackWithOptions(new

WebForm_PostBackOptions(" olstTask:_ctl1:lbnTask","",true,"","",false) ,

true))">用药患者< / a>< / TD>


以前,ASP.NET 1.1为浏览器生成了javascript看起来很像

类似 -

< TD>< a id =" olstTask__ctl1_lbnTask"

href =" javascript :WebForm_DoPostBackWithOptions(new

WebForm_PostBackOptions(" olstTask:_ctl1:lbnTask","",true,"","",false,

true))">用药患者< / a>< / TD>


我知道System.Web.dll中嵌入了JavaScript,例如 -

函数WebForm_PostBackOptions(eventTarget,eventArgument,validation,

validationGroup,actionUrl,trackFocus,clientSubmit)

我的C#代码背后已经使用System.Web;,我尝试添加<%@

Import Namespace =" System.Web %GT;"到2.0 .aspx文件,但它没有帮助



这个问题。


是否有配置步骤I我失踪了作为港口的一部分到2.0?

I am converting my enterprise solution from VS 2003 (.NET v1.1.4322) to VS
2005 (.NET v2.0.50727). The entire solution uses serveral technologies -
Windows Server 2003 (AD, SQL Server 2000, IIS, ASP.NET, ASP.NET Mobile)
Windows Mobile 2003 (Pocket IE)

I have completed a portion of the conversion (ASP.NET Mobile pages for PIE,
and some of the ASP.NET-bases web services), and while
testing I have a runtime error that did not exist in the 1.1 version.
It is associated with a Windows Mobile ObjectList (mobile:ObjectList )
When debugging on the desktop in IE 6.0 (I have *not* yet started conversion
testing with PIE on the PDA), I click on a linkbutton in the object list and
now receive a JavaScript error -
WebForm_PostBackOptions is undefined.

I am not using Javascript explicitly in my code, the error is caused by
ASP.NET 2.0-generated Javascript.
My .aspx code for LinkButtons in the ObjectList looks like -
(<asp:LinkButton ID="lbnTask" CommandName="details" Runat="server"><%#
((ObjectListItem)Container)["name"] %></asp:LinkButton>)

ASP.NET 2.0 generates javascript for the browser that looks like -
<TD><a id="olstTask__ctl1_lbnTask"
href="javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("olstTask:_ctl1:lbnTask", "", true, "", "", false,
true))">medicate patient</a></TD>

Previously, ASP.NET 1.1 generated javascript for the browser that looks very
similar -
<TD><a id="olstTask__ctl1_lbnTask"
href="javascript:WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions("olstTask:_ctl1:lbnTask", "", true, "", "", false,
true))">medicate patient</a></TD>

I know there is JavaScript embedded in System.Web.dll, for example -
function WebForm_PostBackOptions(eventTarget, eventArgument, validation,
validationGroup, actionUrl, trackFocus, clientSubmit)
My C# code behind already has "using System.Web;", and I tried adding "<%@
Import Namespace="System.Web" %>" to the 2.0 .aspx file, but it did not help
with
this issue.

Is there a configuration step I am missing as part of the "port" to 2.0?

推荐答案

我有一个类似的问题,它是一个HttpModule阻止了ASP.NET

服务于" WebResource.axd的"文件(ASP.NET 2.0使用它来提供脚本,这与ASP.NET 1.1不同。)


这可能是你的问题吗?也许试着暂时删除任何模块

并查看它是否消失。


Josh
http://www.thejoyofcode.com/

I had a similar problem and it was a HttpModule that prevented ASP.NET
from serving the "WebResource.axd" file (ASP.NET 2.0 uses this to
deliver scripts, this is different to ASP.NET 1.1).

Could this be your problem? Maybe try temporarily removing any modules
and see if it goes away.

Josh
http://www.thejoyofcode.com/


Josh -

感谢您的回复。


您说可能是HttpModule阻止ASP.NET提供

" WebResource.axd的"文件。


我完全不确定这意味着什么。你能说几句关于

的话,我可以检查一下它是否被阻止了。某个日志文件?


" Josh Twist"写道:
Josh -
Thanks for your reply.

You said it might be that an HttpModule prevented ASP.NET from serving the
"WebResource.axd" file.

I am not at all sure what that means. Can you say a few more words about
what I might check to see if it is blocked. A log file somewhere?

"Josh Twist" wrote:
我有一个类似的问题,它是一个HttpModule阻止ASP.NET
提供WebResource.axd文件(ASP.NET 2.0使用它来提供脚本,这与ASP.NET 1.1不同。)

这可能是你的问题吗?也许试着暂时移除任何模块
并查看它是否消失。

Josh
http://www.thejoyofcode.com/
I had a similar problem and it was a HttpModule that prevented ASP.NET
from serving the "WebResource.axd" file (ASP.NET 2.0 uses this to
deliver scripts, this is different to ASP.NET 1.1).

Could this be your problem? Maybe try temporarily removing any modules
and see if it goes away.

Josh
http://www.thejoyofcode.com/



使用的大部分JavaScript函数由ASP.NET提供的新的

''页面''称为WebResource.axd。你能否在你的

来源中看到这个链接,看起来像是:


< script src =" WebResource.axd ......


我有一个HttpModule拦截了对我服务的所有请求

重写网址(例如 http://mydomain.com/showcategory.aspx?cat=taps
http://mydomain.com/taps) 。事实证明,这是停止了发送脚本的axd

我得到了一堆XXX未定义

错误。


Josh

Most of the JavaScript functions used by ASP.NET are served by a new
''page'' called WebResource.axd. Can you see a link to this in your
source, would look something like:

<script src="WebResource.axd...

I had a HttpModule that intercepted all requests to my service to
rewrite urls (e.g. http://mydomain.com/showcategory.aspx?cat=taps to
http://mydomain.com/taps). It turned out that this was stopping the axd
from sending the script down and I got a heap of XXX is undefined
errors.

Josh


这篇关于2.0运行时javascript错误 - WebForm_PostBackOptions未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆