如何获取在ClientValidationFunction
属性中标识的JavaScript函数中的值,该属性是在ControlToValidate
控件的asp:CustomValidator
属性中标识的控件中输入的?
function MyValidateFunction(sender, args) {
//want to get value of MyControl
}
<asp:CustomValidator
ID="cvAlarmedLocationAddress"
runat="server"
ControlToValidate="MyControl"
ClientValidationFunction="MyValidateFunction"
Text=""
/>
答案 0 :(得分:2)
检查javascript中args.Value
属性的值。以下是MSDN库中的C#示例: