【发布时间】:2010-10-18 05:18:15
【问题描述】:
我无法让这个 CustomValidator 工作。
在
中:<script language="javascript" type="text/javascript">
function ValidateFile(sender, args){
alert("Hi");
args.IsValid = document.getElementById("fuFile").value != "" ||
document.getElementById("c101_c7").value != "";
}
</script>
在体内:
<asp:FileUpload ID="fuFile" runat="server" size="70"/>
<asp:TextBox ID="c101_c7" class="textbox" runat="server"/>
<asp:CustomValidator ID="vldFile" runat="server" ClientValidationFunction="ValidateFile"
ErrorMessage="You must either upload a file or provide a URL of a file."></asp:CustomValidator>
如果必须填写 FileUpload 或 TextBox,args.IsValid 中应该包含什么?
【问题讨论】:
标签: .net asp.net javascript validation