Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Custom validator
Message
From
10/10/2002 14:40:26
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Custom validator
Miscellaneous
Thread ID:
00710013
Message ID:
00710013
Views:
50
hello all, i keep getting an object requested error when using the custom validator control. this is a very simple web page. it just has a text box, a command button and the custom validator control. Below is the html.
<%@ Page Language="vb" AutoEventWireup="false" 
Codebehind="OrderSupplies.aspx.vb" Inherits="supplies.OrderSupplies"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>OrderSupplies</title>
		<script language="vbscript">
	    Sub ValidateQuantity(s, e)
	        Dim strValue As String

		    strValue = e.Value
			e.IsValid = True

			If Not IsNumeric(strValue) Then
				e.IsValid = False
			End If
	    End Sub
		</script>
		<meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
		<meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" 
				 name="vs_targetSchema">
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			 
			<asp:label id="Label1" style="Z-INDEX: 101; LEFT: 13px;
			POSITION: absolute; TOP: 70px" runat="server">Enter Quantity:</asp:label>
			<asp:textbox id="txtQuantity" style="Z-INDEX: 102; LEFT: 112px; 
			POSITION: absolute; TOP: 71px" runat="server">0</asp:textbox>
			<asp:button id="cmdAdd" style="Z-INDEX: 104; LEFT: 113px; 
			POSITION: absolute; TOP: 102px" runat="server" 
			Text="Add to Cart"></asp:button>
			<asp:customvalidator id="CustomValidator" style="Z-INDEX: 105; 
			LEFT: 282px; POSITION: absolute; TOP: 101px" runat="server" 
			ControlToValidate="txtQuantity" 
			ErrorMessage="Must enter a quantity greater than zero." 
			ClientValidationFunction="ValidateQuantity" 
			Display="Dynamic"></asp:customvalidator>
		</form>
	</body>
</HTML>
Randy Belcher
AFG Industries, Inc.
Next
Reply
Map
View

Click here to load this message in the networking platform