C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ASP.NET WebForms »

How To Validate Amount in ASP.NET


Posted Date: 29 Sep 2009    Resource Type: Code Snippets    Category: ASP.NET WebForms
Author: Gopal Singh RathoreMember Level: Silver    
Rating: 1 out of 5Points: 2



Validate amount in asp.net


This code demonstrates how to validate amount in asp.net


<table >
<tr>
<tr>
<td style="width: 161px; height: 29px;">
<asp:Label ID="Label8" runat="server" Text="Required Loan Amount: *" Width="162px"></asp:Label></td>
<td style="width: 196px; height: 29px;">
<asp:TextBox ID="txtAmount" runat="server" Width="221px"></asp:TextBox>
</td><td style="width: 47px; height: 29px">
<asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtAmount"
ErrorMessage="Enter Digits Only ($4,000.00) | -$4000.00 | -$400.00 | 12.00" ValidationExpression="^\$?\-?([1-9]{1}[0-9]{0,2}(\,\d{3})*(\.\d{0,2})?|[1-9]{1}\d{0,}(\.\d{0,2})?|0(\.\d{0,2})?|(\.\d{1,2}))$|^\-?\$?([1-9]{1}\d{0,2}(\,\d{3})*(\.\d{0,2})?|[1-9]{1}\d{0,}(\.\d{0,2})?|0(\.\d{0,2})?|(\.\d{1,2}))$|^\(\$?([1-9]{1}\d{0,2}(\,\d{3})*(\.\d{0,2})?|[1-9]{1}\d{0,}(\.\d{0,2})?|0(\.\d{0,2})?|(\.\d{1,2}))\)$" Display="None">*</asp:RegularExpressionValidator></td>
</tr>
<tr>
<td style="width: 161px; height: 5px">
</td>
<td style="width: 196px; height: 5px">
<asp:Button ID="Button1" runat="server" Text="Submit" OnClientClick="alert('Do You Want To Submit')" OnClick="Button1_Click" />


<asp:Button ID="Button2" runat="server" Text="Reset" OnClick="Button2_Click" /></td>
</tr>
</table>



Responses

Author: Gopal Singh Rathore    30 Sep 2009Member Level: Silver   Points : 2



*









Cell Phone:



  

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Validate  .  How To Validate Amount in ASP.NET !!!  .  Asp.net  .  Amount  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How To Validate US Zip Code: in ASP.NET
Previous Resource: Create Rotating Ads for your site.
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use