.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

ASP.NET web application - Serverside validation of form field's data

Posted By: Venkat     Posted Date: September 13, 2009    Points:2   Category :ASP.Net
We are building an ASP.NET application with C#.net as language.

Here we are validating the form field's data at client side using ASP.NET validation controls. Now we are planning to validate the form field's data at the server side too, to avoid script injections by hackers.

Would you please guide me on this, if you have an idea?

If would be great if you could also provide a reference document or web references (If needed).

Many Thanks,

Author: Lakhan Pal Garg             
Posted Date: September 13, 2009     Points: 5   

You can use Regular Expression to Validate at server side.

here is the example to validate email id at server side:

Regex regEmail = new Regex(@"^(([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)?(\.[a-zA-Z0-9_-]+))$");


IsMatch will return Boolean value.

Thanks & Regards
Lakhan Pal Garg

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend