一个模式弹出里面的OK按钮的事件处理程序不执行 [英] The Event Handler of the OK button inside a Modal PopUp is not executing

查看:247
本文介绍了一个模式弹出里面的OK按钮的事件处理程序不执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里问题是,我有一个模式弹出扩展用户控制,这是从页面内的另一个用户控件调用内部的母版页中。页面加载dinamically第一个用户控制,当我想要显示的模式对话框它dinamically加载用户控制到一个占位符,并调用模式的显示方式,当模式弹出建立用户控制负荷。

Problem here is, i have a Modal PopUp Extender inside a User Control, which is called from another User Control inside a Page, inside a Master Page. The Page loads the first user control dinamically and when i want to display the modal dialog it loads the User Control into a placeholder dinamically and call the show method of the modal when the Modal Pop Up User control loads.

模态里面我有一些文本框和一个按钮,一些数据保存到数据库中。

Inside the modal I have some TextBoxes and a Button to save some data into the database.

问题是,布敦onClick事件不火的。我尝试添加了模态控制的onload事件断点,但它并没有在那里得到的,奇怪的是,如果我把在父用户控件(即持有模式弹出的那个)的Onthe加载事件另一个断点断点并在父用户控件的onload事件正确停止。我需要使用事件处理程序,因为在那里我调用存储过程将数据保存到数据库。

The problem is that the Buton onClick event doesn't fire at all. I tried adding a breakpoint in the Onload event of the Modal Control, but it doesn't get in there, oddly enough, if i place another breakpoint in Onthe load event of the Parent User Control (the one that holds the Modal PopUp) the breakpoint does stop correctly at the Parent User Control's OnLoad event. I need to use the event handler, because there's where i call the Stored Procedure to save the data into the DB.

请注意,我不希望只是关闭modalpopup窗口,我想验证某些文本框,然后一些数据保存到数据库中,这就是为什么我要我们的按钮埃特事件处理程序。

Please note that i don't want to just close the modalpopup window, i want to validate some textboxes then save some data into the database, that's why i must us ethe event handler of the button.

Thaks的支持

推荐答案

它可能是迟到了给定的情景,但我对我的项目升级AjaxControlToolikit版本后有同样的问题。

it's probably late for the given scenario, but I had the same issue after upgrading AjaxControlToolikit version on my projects.

问题是ModalPopupExtender属性OkControlID:在工具包服务器侧的较新版本的点击的按钮的处理程序将不执行,它将被运行,相反,OnOkScript客户端code

Problem is the ModalPopupExtender property OkControlID: in the newer versions of the toolkit server side clicked button's handler won't execute, it will be run, instead, the OnOkScript client-side code.

要恢复以前的行为,在我的情况,我不得不从模式弹出扩展声明标记删除OkControlID属性。

To restore old behavior, in my case, I had to remove OkControlID property from modal popup extender declaration tag.

希望它帮助。

这篇关于一个模式弹出里面的OK按钮的事件处理程序不执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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