TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
vasanth kumar
1.2k
236
25.3k
Validate the email Id
Oct 6 2015 12:46 AM
Hi Professionals,
I'm trying to validate the email id.But i'm not getting .Here i attached my code.
if (txtEmailID.Text == "")
try
{
bool isEmail = Regex.IsMatch(txtEmailID.Text.Trim(), @"\A(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)\Z");
if (txtEmailID.Text == "")
{
focustextbox.Text = txtEmailID.ID;
ShowPopUpMsg("Email ID must be given");
// throw new ApplicationException("Email ID must be given");
}
else if (!isEmail)
{
focustextbox.Text = txtEmailID.ID;
ShowPopUpMsg("Invalid E-Mail");
//throw new ApplicationException("Invalid E-Mail");
}
}
catch (Exception ex)
{
oErrorLog.WriteErrorLog(ex.ToString());
}
finally
{
if (objSqlDataReader != null)
{
objSqlDataReader.Dispose();
objSqlDataReader.Close();
}
}
}
catch (Exception ex)
{
oErrorLog.WriteErrorLog(ex.ToString());
}
finally
{
if (objSqlDataReader != null)
{
objSqlDataReader.Dispose();
objSqlDataReader.Close();
}
}
Reply
Answers (
2
)
Crate WEB API with database Oracle
restrict download option from pdf in c#