回发两次如何处理 [英] Post back twice How to handle it

查看:67
本文介绍了回发两次如何处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有ajax选项卡的``ascx''控件

当我单击下拉菜单或任何服务器控件(如按钮,下拉菜单等)的"asp:button"或"selected change"事件时,每个控件都会发回两次.

为什么会发生?

它应该像往常一样回发1次

可能是什么问题?

需要帮助

没有JavaScript或ajax用于提交表单

I am using ''ascx'' control with ajax tab

When I click the ''asp:button'' or ''selected change'' event of drop down or any server control like button, drop down etc, every control posts back twice.

Why its happening?

It should post back 1 time as it usually happens

What could be the issue?

Need Help

No JavaScript or ajax used to submit form

推荐答案

如果您具有执行document.formName.submit()的javascript函数,并且具有在提交时具有提交按钮的表单单击提交,表单将被提交两次.一种避免这种情况的简单方法是将提交按钮的类型从提交"更改为按钮",然后只有javascript函数将提交表单.

祝你好运!
If you have a javascript function which does document.formName.submit() and a form that has a submit button when you click on submit the form will be submitted twice. A simple way to avoid that it is to change the type of the submit button from "submit" to "button" then only the javascript function will submit the form.

Good luck!


这篇关于回发两次如何处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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