简体   繁体   English

Safari 5.1.5无法触发回发

[英]Postback not firing with Safari 5.1.5

I am currently developing a web application in ASP.NET Framework 4 and I am experiencing problems with Safari 5.1.5. 我目前正在ASP.NET Framework 4中开发Web应用程序,而Safari 5.1.5遇到了问题。 My web app is running fine with Internet Explorer 9, Firefox 11 and Chrome 18. 我的Web应用程序在Internet Explorer 9,Firefox 11和Chrome 18上运行良好。

When I click a button with a server event (PostBack), it doesn't fire. 当我单击带有服务器事件的按钮(PostBack)时,它不会触发。 None of them, so impossible to use the web app at all. 它们都不是,因此根本无法使用Web应用程序。

Is there someone who experienced that issue? 有人遇到过这个问题吗?

EDIT 编辑

For example, for a button that does a PostBack, the browser gets this code: 例如,对于执行回发的按钮,浏览器将获得以下代码:

<input type="submit" name="ctl00$MainContent$cmdClose" value="Fermer" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$MainContent$cmdClose&quot;, &quot;&quot;, true, &quot;Fields&quot;, &quot;&quot;, false, false))" id="ctl00_MainContent_cmdClose" style="height:30px;width:150px;height: 30px" />

Second EDIT 第二次编辑

In the JavaScript console, I get the exception PageRequestManagerParserErrorException 在JavaScript控制台中,我得到异常PageRequestManagerParserErrorException

Third EDIT 第三编辑

The ASPX ASPX

<asp:Button ID="cmdClose" runat="server" Text="Fermer" Width="150px" OnClick="cmdClose_Click" ValidationGroup="Fields" Height="30px" />

The C# C#

protected void cmdClose_Click(object sender, EventArgs e)
{ /*Some Code*/}

I just solved the problem with this site. 我刚刚解决了这个网站的问题。

Add a PostBackTrigger to your UpdatePanel that points at the button. 向您的UpdatePanel添加一个指向该按钮的PostBackTrigger。 This works great if the button is declared statically through markup on the page. 如果按钮是通过页面上的标记静态声明的,则效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM