表单提交在 IE6/7 中失败,在 FF3 和 Chrome 中工作正常
自上周末以来,仅使用 IE 登录我们的供应商网站时出现问题。 在 FF3 和 Chrome 中它运行良好。 这是一个简单的 ASP.NET (1.1) 站点,使用以下代码作为登录按钮:
<asp:button id="btnLogin" runat="server" CssClass="dll-button" Text="Login">
</asp:button>
在 HTML 中,此代码转换为
<input type="submit" name="btnLogin" value="Login"
onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); "
language="javascript" id="btnLogin" class="dll-button" />
当我不输入用户名时,我收到一条消息,提示需要输入用户名,因此会发生一些情况,但表单没有提交到服务器。 在我看来,这像是一个客户端(仅限 IE)问题,但所有 IE 客户端都自发地开始表现得像这样。 这就是为什么我怀疑服务器。 我发现上周末服务器上有 2 个 .NET 框架更新,这可能会导致问题,KB928366 和 KB947742。 但我无法将这些更新描述与我们现在面临的问题联系起来。
我是否忽略了什么?
我正在考虑卸载这些更新。 这能解决什么问题吗?
问候, 罗尔
Since last weekend there is a problem logging in on our vendor site with IE only. In FF3 and Chrome it works fine.
This is a simple ASP.NET (1.1) site using the following code for the login button:
<asp:button id="btnLogin" runat="server" CssClass="dll-button" Text="Login">
</asp:button>
In HTML this is converted to
<input type="submit" name="btnLogin" value="Login"
onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); "
language="javascript" id="btnLogin" class="dll-button" />
When I don't enter a username I get a message that it's required so something happens, but the form is not submitted to the server.
Sounds to me like a client (IE-only) problem, but all IE-clients spontaniously started behaving like this. That's why I suspect the server, though. I found out there were 2 .NET framework updates on the server last weekend, that might cause the problems, KB928366 an KB947742. But I can't relate these update-desciptions to the problems we're facing now.
Am I overlooking something?
I'm considering to uninstall these updates. Could that solve anything?
Regards,
Roel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
FF 和 IE 处理提交的方式不同,例如,您无法在 IE 中重定向提交处理程序,但可以在 FF 中重定向。 上面的代码仅适用于按钮上的 click 事件,如果您按 Enter 键,则不会触发该事件(至少在 IE 中不会),然后只会触发表单上的提交事件,“忽略”按钮的 onclick 事件(该按钮毕竟没有被点击)。
在点击/提交方面,IE、FF 和 C 之间存在相当多的细微差别,所有这些都可能导致您报告的问题。
一次尝试一个,如果您还没有安装,请尝试安装一个 JavaScrip 调试器(VS 或 FireBug 都可以)。 这样您就可以看到浏览器之间执行的差异
FF and IE handles submit differently E.g. you can't redirect in you submit handler in IE but you can in FF. The above code is only for the click event on the button, which will not be fired (at least not in IE) if you press enter, then only the submit event on the form will be fired "ignoring" the onclick event of the button (The button is after all not clicked).
There is quite a few tho small differences between, IE, FF and C when it comes to click/submit that all might cause the issue you reported.
TRy one at a time and if you haven't already installed try installing a JavaScrip debuger (VS will do or FireBug). That way you'll be able to see the difference in execution between the browsers