本文介绍了提取控制值在ControlToValidate属性在CustomValidator控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何获得在 ClientValidationFunction
属性标识的JavaScript函数是在是在的ControlToValidate $确定的控制输入的值C $ C> A
ASP的财产:的CustomValidator
控制
函数MyValidateFunction(发件人,参数){
//希望得到MyControl价值
}< ASP:的CustomValidator
ID =cvAlarmedLocationAddress
=服务器
的ControlToValidate =显示myControl
ClientValidationFunction =MyValidateFunction
文本=
/>
解决方案
检查您的JavaScript的 args.Value
属性的值。下面是从MSDN库中的C#示例:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.customvalidator.clientvalidationfunction.aspx#Y570
How do get the value in the JavaScript function identified in ClientValidationFunction
property that was entered in the control that was identified in the ControlToValidate
property of a asp:CustomValidator
control?
function MyValidateFunction(sender, args) {
//want to get value of MyControl
}
<asp:CustomValidator
ID="cvAlarmedLocationAddress"
runat="server"
ControlToValidate="MyControl"
ClientValidationFunction="MyValidateFunction"
Text=""
/>
解决方案
Check the value of the args.Value
property in your javascript. Here is a C# example from the MSDN library:
这篇关于提取控制值在ControlToValidate属性在CustomValidator控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!