Which two code segments should you use?

You are implementing an ASP.NET Web page.
You need to add a text box that allows only values between 1 and 10, inclusive, to be submitted.
Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.)

You are implementing an ASP.NET Web page.
You need to add a text box that allows only values between 1 and 10, inclusive, to be submitted.
Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.)

A.
<script type=”text/javascript”>
function validate_value(obj, args)
{
return (args.Value >= 1 && args.Value <= 10);
}
</script>

B.
<script type=”text/javascript”>
function validate_value(obj, args)
{
args.IsValid = (args.Value >= 1 && args.Value <= 10);
}
</script>

C.
<asp:TextBox ID=”txt1″ runat=”server” />
<asp:CustomValidator ID=”val1″ runat=”server” ControlToValidate=”txt1″
ClientValidationFunction=”validate_value” ErrorMessage=”Value invalid” />

D.
<asp:TextBox ID=”txt1″ runat=”server” onChange=”validate_value(this, args)” />



Leave a Reply 0

Your email address will not be published. Required fields are marked *