------------Script---------------------------
< script type="text/javascript">
function Validateddl(source, args) {
var str = TrimSpaces(args.Value);
if (str == "--Select--") {
args.IsValid = false;
return;
}
args.IsValid = true;
}
< /script>
------ Example------------------------------------------------------------
< asp:DropDownList ID="ddlCreatorGroup" runat="server" CssClass="dropdown">
< /asp:DropDownList >
< asp:CustomValidator ID="CustoddmValidator2" ClientValidationFunction="Validateddl" Display="Dynamic" ControlToValidate="ddlCreatorGroup" runat="server"
ErrorMessage="Please select creator group"> < /asp:CustomValidator >
No comments:
Post a Comment