User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 402,549 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,298 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 906 | Replies: 2
Reply
Join Date: Aug 2007
Posts: 6
Reputation: kally is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
kally kally is offline Offline
Newbie Poster

Validation COntrol

  #1  
Aug 27th, 2007
Hi All,
Im new to ASP.NET & C#. I have designed a webpage where a user has to give his details like Name, Age, Sex, Location and subnit it to another page. Now it works even if the user gives details only about his name & sex. SO im trying to program it in such a way that only if the user enters all the details, he should be able to submit. I have heard of something called Validation COntrols. I hope I have to make use of this mechanism for my purpose. Hence when I browsed in the net, I came to know about 5-6 functions of Validation COntrols. But im not sure how to incorporate them in my code. COuld anyone help me out?
Thanks.
Kally
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2006
Posts: 61
Reputation: pygmalion is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
pygmalion's Avatar
pygmalion pygmalion is offline Offline
Junior Poster in Training

Re: Validation Control

  #2  
Aug 29th, 2007
as you're trying to enable validation in a webpage, why not use JavaScript?

else, you can still implement regular expressions in your code to check on input fields. this you can do in your backbone c#-code as follows. first include the following library.
using System.Text.RegularExpressions;
then, create a Regex object and join it with a regular expression. if you have difficulties with that, i'd be glad to help.
Regex exp = new Regex(@"...");

hope this helped
pygmalion
Last edited by pygmalion : Aug 29th, 2007 at 7:51 pm.
Microsoft: "You've got questions. We've got dancing paperclips."
Reply With Quote  
Join Date: Aug 2007
Posts: 12
Reputation: yasserstein is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
yasserstein yasserstein is offline Offline
Newbie Poster

Re: Validation COntrol

  #3  
Aug 30th, 2007
you can use the RequiredFieldValidator in VS validation controls.
using this control is extremely easy. you just set the ControlToValidate field with the control you need to set as required, and you enter some text for the ErrorMessage and you're done.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C# Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C# Forum

All times are GMT -4. The time now is 9:01 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC