0
我想在出现错误消息后添加链接。目前,我有这个在我的代码:添加错误消息附近的链接
<asp:CustomValidator ID="CV2" runat="server" ClientValidationFunction="Validate"
ForeColor="Red" OnServerValidate="Server_Validate" ValidationGroup="group"
ErrorMessage="You have not validated." Display="Dynamic" Enabled="false"
ControlToValidate="txtAmount" />
的JavaScript:
function Validate(source, arguments) {
var validAmount = document.getElementById('<%= validate.ClientID %>').innerHTML.replace('$', '').replace(/,/g, '');
if (arguments.Value > validAmount)
arguments.IsValid = false;
else
arguments.IsValid = true;
}
C#代码:
protected void Server_Validate(object source, ServerValidateEventArgs args)
{
try
{
//Some C# code here.
}
}
什么是对此最好的方法呢?谢谢。