Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 9th, 2006, 09:08 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default RegEx Bug??

Ok,
  I wrote a Regular Expression that works fine in a RegularExpressionValidator problem is, the text boxes they are validating autopost back (unfortunately they have to to meet a functional requirement) so, even if the user inputs invalid data, there is no way (that i know of) to prevent the post back from occuring if the data is invalid!

So I wrote a function like so:

bool CheckMoney(string Value) {
        System.Text.RegularExpressions.Regex ex = new System.Text.RegularExpressions.Regex("[0-9]+(\\.[0-9][0-9])?");
        return ex.Match(Value).Success;
    }

The regex should ONLY validate values of XXX.XX and, as i said, it works fine in a validator; but when I placed it in this function it will return true if the data is XXX.X, XXX.XX, XXX.XXX

Does anyone know why this is or, alternatively, how to prevent an autopost back from occuring if the validator rises?

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex pendemv JSP Basics 4 December 8th, 2008 08:29 AM
Bug or no to bug learning C using VS.Net to compil tesh All Other Wrox Books 0 February 14th, 2007 01:06 PM
Regex htran XSLT 2 May 18th, 2005 09:21 AM
More regex help Snib Pro PHP 4 December 16th, 2004 09:56 PM
Regex Help boyer99g General .NET 2 October 8th, 2004 05:46 PM



All times are GMT -4. The time now is 10:03 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.