473,387 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Textbox validation in vb.net

Prathap
37
I had used this code to validate email id in textbox,but it is not working properly pls help me. thanks in advance

Expand|Select|Wrap|Line Numbers
  1. Dim Expression As New System.Text.RegularExpressions.Regex("^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$")
  2. If Expression.IsMatch(Textbox1.Text) Then
  3. MsgBox("The email address is valid.")
  4. Else
  5. MsgBox("The email address is NOT valid.", MsgBoxStyle.Critical, "Invalid Mail ID")
  6. Exit Sub
  7. End If 
  8.  
Dec 8 '11 #1
2 3113
Ammu
78
Actually your code is correct
I just copy your code into my page and run its working
Dec 9 '11 #2
Prathap
37
Its working,that was my mistake.thanks for your response.
Dec 10 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bryan | last post by:
I trying to figure out out to validate a textbox inside a repeater once a person presses a button on a repeater. Here's the validation Code behind: Please be aware that line e.Item.ItemIndex...
4
by: Craig G | last post by:
i have the following code for validating a textbox once a page posts, but the problem i am having is that the TextChanged event won't fire next time if the user does not change the value again ...
1
by: Mariame | last post by:
Hi Everyone I have a textbox that i created online in Form Load: "Dim TB1 as new TextBox" I want to validate that this textbox contains numbers only??? Is There is a way i can do it uing...
1
by: Kum | last post by:
Hi, I need help in asp.net dynamic textbox controls validation. I am creating textbox controls dynamically on a asp.net webpage. Now after creating the textboxes on the page I want to validate...
1
by: Eugenio.Net | last post by:
Hello all I'm using a button to validade a TextBox but I already saw some websites that validation is automaticaly after 4 or 5 chars... How can I validate my textox to call a function??? ...
0
by: slekshmipriya | last post by:
Hai friends i have a problem with my code.When my form get loaded it will contain the rollno, name and textbox to enter mark of the students.These are fetched from my table named details.The marks...
1
by: Madhumitham | last post by:
textbox validation (to enter numbers) in vb.net in both client side and server side
1
by: timnels | last post by:
I have an form that sends a message (an employee code) to another form. When that form receives the message it plops that value in a textbox and I want to run the code in the validation event of...
2
by: Durango2008 | last post by:
Hi I have written code to validate a textbox and if that textbox is valid I would like to make the submit button on the page enabled otherwise leave it disabled, which is what its default value...
9
mageswar005
by: mageswar005 | last post by:
Hi Guys, My array textbox validation is not working fine,my code is given below please help me immediately. function validation() { var chks =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.