|
-
Dec 9th, 2005, 02:04 AM
#1
Thread Starter
Hyperactive Member
REGEX in Page behind?
I am writing an app in ASP.NET 2.0. I want to have the code behind use a regex to validate a field. Any ideas on how to do this? The code is VB.NET
I need to do it in code behind because if I do it in the validation control it checks the field when the page loads.
thanks in advance
-
Dec 9th, 2005, 12:33 PM
#2
Fanatic Member
Re: REGEX in Page behind?
Needs to be posted in the VB.NET section.....
Kai
As the information I give is useful in its nature, consider using the RATE POST feature located on the bottom left of this post please..
A few things that make a good Developer a Great One.
Methodical and a thorough approach to research and design inevitably leads to success.
Forward thinking is the key to Flow of control.
Never test in the design environment, always test in real time, you get the REAL results.
CBSE & OOSE are the same animal, they just require different techniques, and thinking.
SEO is a globe of objectives, SE rankings is an end to a means for these objectives, not part of them.
The key to good design is explicit attention to both detail and response.
Think Freely out of the "Box" you're in..... You will soar to better heights.
Kai Hirst - MSCE, MCDBA, MCSD, MCP, MCAP, MSCT
-
Dec 10th, 2005, 03:02 PM
#3
Re: REGEX in Page behind?
VB Code:
Dim regex As New RegularExpression("expressionhere")
If regex.IsMatch(TextBox1.Text) THen
'...
End If
I haven't checked it, but I think you can also make the regular expression validator work on postback too, instead of the page itself.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|