显示使用RequiredFieldValidators正确的顺序,ValidatorCallout和验证的ModalPopupExtender是OK [英] Display in correct order using RequiredFieldValidators, ValidatorCallout and a ModalPopupExtender of validation is OK
问题描述
我试图让事情按正确的顺序发生的序列,但没有运气。我所拥有的是一个数字与ASP领域:ReuiredFieldValidators和ASP:ValidatorCallout显示验证消息。这是触发一个按钮来保存与验证=真正的。
I'm trying to get a sequence of things to happen in the correct order, but no luck. What I have is a number of fields with asp:ReuiredFieldValidators and asp:ValidatorCallout to display validation messages. This is triggered with a button Save with validation="true".
如果全部有效,但应该显示一个模式对话框,询问有关如何保存数据的两个,选项。无论答案,就应该始终不断在此阶段落后保存function.The AjaxToolkit_ModalPopupExtender code被连接到相同的保存按钮。
If all validates, it should display a modal dialog asking for two choises on how to save the data. No matter the answer, it should always continue at this stage to code behind save function.The AjaxToolkit_ModalPopupExtender is connected to the same save button.
什么情况是,验证标注和模态对话框同时显示。
What happens is that the validation callouts and modal dialog is shown at the same time.
搜索的提示和帮助,但没有发现任何对我来说,很有帮助!万分感谢您的帮助!
Searched for tips and help but haven't found any, for me, helpful! Most grateful for any help!
干杯
/约翰
推荐答案
您可以从codebehind显示 ModalPopup
(在 BtnSave。点击
-handler)如果页面是有效的:
You can show the ModalPopup
from codebehind(in BtnSave.Click
-handler) if the page is valid:
Page.Validate("YourValidationGroup");
If(Page.IsValid){
ModalPopup1.Show();
}
因此,你需要设置的TargetControlID
的 ModalPopupExtender
来一个隐藏按钮:
<asp:Button ID="Hid_ShowDialog" Style="display: none" runat="server" />
这篇关于显示使用RequiredFieldValidators正确的顺序,ValidatorCallout和验证的ModalPopupExtender是OK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!