<%@ Page Language="c#" Debug="true" %>
<script Language="c#" runat="server">
void CompleteOrder(object sender, EventArgs e)
{
if (txtQuantity.Text != "")
{
if (!(Char.IsNumber(txtQuantity.Text,0)))
{
if (txtQuantity.Text.Substring(0,1) != "-")
{
lblOrderConfirm.Text = "Please provide only numbers in Quantity field.";
}
else
{
lblOrderConfirm.Text = "Please provide a Quantity greater than 0.";
}
}
else if (Convert.ToInt32(txtQuantity.Text) == 0)
{
lblOrderConfirm.Text = "Please provide a Quantity greater than 0.";
}
else if (Convert.ToInt32(txtQuantity.Text) > 0)
{
lblOrderConfirm.Text = "Order Successfully placed.";
}
}
else
{
lblOrderConfirm.Text = "Please provide an Order Quantity.";
}
}
</script>
<html>
<head>
<title>Manual Trapping Example</title>
</head>
<body>
<form method="post" action="manualtrapping.aspx" runat="server">
<asp:Label text="Order Quantity" runat="server" />
<asp:TextBox id="txtQuantity" runat="server" />
<br />
<asp:Button id="btnComplete_Order" Text="Complete Order"
onclick="CompleteOrder"
runat="server"/>
<br />
<asp:Label id="lblOrderConfirm" runat="server"/>
</form>
</body>
</html>
|