2010-02-22 40 views
0

我遇到了一个非常奇怪的错误。为什么asp.net UpdatePanel会破坏我的网址(.aspx0)?

我有一个工作得很好的页面,没有UpdatePanel。当我用UpdatePanel包围东西时,出现此错误:

Server Error in '/' Application. 

The resource cannot be found. 

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /SearchTicket.aspx0 

Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082 

页面名称为SearchTicket。 aspx。当启用UpdatePanel时,它会尝试打开一个SearchTicket。 aspx0,显然不能做到这一点,然后返回一个404

这是一个已知的bug?我在网上找不到关于它的线索。

备注:页面首次按预期加载。第一次更新使这发生。

+0

? – Eric

+0

是的!在这种情况下,updatepanel在searchticket中声明,而不是在.master中声明。我没有在其他地方的应用程序 –

回答

0

给这个镜头。我不知道为什么这样做,但这可能会解决它。

试试这个:

function pageLoad(sender, args) { 
if(args.get_isPartialLoad()) { 
    var form = $get('Formname'); 
    form._initialAction = form.action = '../SearchTicket.aspx'; 
} 
} 

我您使用的母版页阅读,这也可能工作

 Sys.Application.add_load(function() 
{ 
    var form = Sys.WebForms.PageRequestManager.getInstance()._form; 
    form._initialAction = form.action = window.location.href; 
}); 

Check out this site.

And perhaps this one may help you

+0

更新面板感谢eric!在ajax调用成功之后,beginrequest中的rewritepath使得页面重新启动,因此所有内容都被重置(但是,在页面重新启动之前,ajax调用成功,事情看起来像预测的那样)。这两个js在我的页面中没有工作。第二个不能编译,第一个说这个$ get不存在。 =/ –

+0

代替$ get使用document.getelementbyid(id)(使用正确的大写字母) – Eric

+0

代码没有返回错误,但.aspx0被再次加载。此时,我放弃了使用此页面的UpdatePanel。截止日期很糟糕,UpdatePanel不是必需的。 –

相关问题