任何按钮单击都会关闭ModalPopupExtender [英] ModalPopupExtender closes on any Button Click

查看:161
本文介绍了任何按钮单击都会关闭ModalPopupExtender的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在masterpage中添加了一个modalpopup,即使文本框中的数据根据​​RequiredFieldValidator无效,它也会被关闭。即使单击确定/取消按钮ID,它也会关闭。除了模态弹出窗口,我还添加了ConfirmButtonExtender。另外,我提到了 ASP.NET AJAX Control Toolkit ModalPopupExtender Control in Action [ ^ ]但没有得到要求。

Plz帮助......:confused:

我已经尝试了所有4个解决方案但没有得到预期的结果..

:confused:

I have added a modalpopup in masterpage which gets closed even if data in textboxes is not valid as per the RequiredFieldValidator. It closes even if OK / Cancel button id clicked. Alongwith modal popup, I have also added ConfirmButtonExtender. Also, I referred to ASP.NET AJAX Control Toolkit ModalPopupExtender Control in Action[^] but not getting the required.
Plz help...:confused:
I have tried all 4 solutions but not getting the desired result..
:confused:

推荐答案

将此添加到按钮

add this to your buttons
OnClientClick="JavaScript: return false;"


我同意sudesh。

你需要打电话.show方法的凸起事件上的模态弹出扩展器。



谢谢

Mahesh
I agree with sudesh.
You need to call .show method of modal popup extender on the raised event.

Thanks
Mahesh


Ajax模态弹出窗口关闭,如果它上面的任何控件导致回发。



使用OKControlID和CancelControlID属性模态弹出窗口的s并分别为这些属性分配OK和取消按钮ID。



如果要对OK和取消执行任何操作,请使用OnOKScript和OnCancelScript属性。脚本可以定义为javascript函数。



如果你想从弹出窗口中的控件进行有意回发,那么在执行回发操作后,在末尾添加一行再次显示弹出窗口

ex:mpe.Show();
Ajax modal popup closes if any controls present on it causes a postback.

use OKControlID and CancelControlID properties of the modal popup and assign your OK and cancel button ID's for these properties respectively.

If you want to perform any operations on OK and cancel, use OnOKScript and OnCancelScript properties. the scripts can be defined as javascript functions.

If you want intentional postback from the control present on popup then, after performing your postback action add a line at the end to show the popup back again
ex: mpe.Show();


这篇关于任何按钮单击都会关闭ModalPopupExtender的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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