Insert Cash Snippet

Here is another one I created. Very much like the one for the date picker except this one is for money.

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="">
  <CodeSnippet Format="1.0.0">
      <Description>Inserts controls with validators to enter cash amount into a textbox.</Description>
        <Literal Editable="true">
          <ToolTip>ID of the asp:TextBox control that will hold the cash value.</ToolTip>
        <Literal Editable="true">
          <ToolTip>IDof the RequiredFieldValidator control.</ToolTip>
        <Literal Editable="true">
          <ToolTip>ID of the AjaxControlToolkit ValidatorCalloutExtender control for the required field validator.</ToolTip>
        <Literal Editable="true">
          <ToolTip>ID of the RegularExpressionValidator control.</ToolTip>
        <Literal Editable="true">
          <ToolTip>IDof the AjaxControlToolkit ValidatorCalloutExntender control for the regular expression validator.</ToolTip>
      <Code Language="csharp"><![CDATA[<asp:TextBox ID="$txtCash$" runat="server" Width="50px" />
<asp:RequiredFieldValidator ID="$valrCash$" runat="server" ControlToValidate="$txtCash$" 
    Text="*" ErrorMessage="You must provide the Amount." SetFocusOnError="true" 
<cc1:ValidatorCalloutExtender ID="$vaeRCash$" runat="server" TargetControlID="$valrCash$">
<asp:RegularExpressionValidator ID="$valxCash$" runat="server" ControlToValidate="$txtCash$" 
    Text="*" ErrorMessage="You must provide a valid entry for Amount. #.##" SetFocusOnError="true" 
    Display="Dynamic" ValidationExpression="^-?[0-9]{0,2}(\.[0-9]{1,2})?$|^-?(100)(\.[0]{1,2})?$">
<cc1:ValidatorCalloutExtender ID="$vceXCash$" runat="server" TargetControlID="$valxCash$">

About SheldonS

Web developer for over 15 years mainly with Microsoft technologies from classic ASP to .NET 4. Husband, father, and aspiring amateur photographer.

Posted on June 10, 2011, in Snippet. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: