Subscribe to the ASP.NET Robot RSS Feed

Email Validation

I searched the internet and I found that one of the common questions is how I can validate users email address from code behind.
So In this tutorial I will show you how you can easily validate email address from code behind Using Regular Expression .
For example add one textbox to your page with id=”txtEmail” ,  add one label with id=”lblResult” and add one button, Add this code to the button onclick event:


string pattern = @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";

        Match match = Regex.Match(txtEmail.Text.Trim(), pattern, RegexOptions.IgnoreCase);

        if (match.Success)
           lblResult.Text = "Valid";
            lblResult.Text = "Not Valid";


Don’t forget to add a namespace to the top of the code behind page:

using System.Text.RegularExpressions;

Add New Comment:



Viagra, four for and one for Levitra, said spokeswoman Susan Cruzan.



best weight loss supplements
weight loss injections
natural weight loss supplements
diet pill
new weight loss medication



diet pills
weight loss medications
weight loss pill
weight loss pill
appetite suppressant



Your book there is for a generic cover, left, to return, they rely on more expensive.



[url=]buy hygetropin online uk[/url]
No matter if you love garden, food preparation, movie star gossip, your puppies or science, it is possible to talk about your understanding and get insight with a specific topic by beginning a blog. You may devote as much time as you'd like, making blogging convenient. Recall the recommendations in this post to make the most of your blogging practical experience!Seeking To Stop Smoking? These Ideas May Help!
[url=,Jintropin-Gensci-China,Jintropin-Wiki/]Hgh Apotheke Preis[/url]
Be well prepared for the long haul. Significant and profitable investors think about stock's long term alternatives within both bull and bear market segments. Perseverance is an definite have to if you are intending so that you can refrain from the impulse to aspect with shares ahead of time. Should you anxiety-market a inventory plus it rises better, you're only likely to be sorry.
[url=]buy growth hormone injections uk[/url]
If you are suffering from back pain, use treatments that help radiate warmth in your nerves and muscle tissues. The heat from the cream assists reduce soreness and relax the anxiety of your muscles. It could take a few days of therapy prior to deciding to enjoy the healing qualities in the cream. Make sure to keep raising and shifting as low as possible when suffering from back problems.
[url=]Used Lr3 Uk[/url]



red site [url=]online cc shop[/url]

Facebook FriendFeed Digg it Google Buzz Linked in MySpace Reddit Stumbleupon Twitter Technorati