Hello guys,
since I have now effectively completed my first asp.net application (it's a very basic application where people...ahem, where I can record overtime) I was wondering what the best way is to add some validation. The page which allows you to upload the details needed (date, hours worked and comments) is very simple but two of the fields (date and hours worked)need to be validated. Being as I have many times repeated at the very beginning of my asp.net/visual studio/C#/SQL trip, I thought I'd take a look at some of the Visual Studio 3.5 inbuilt validations but I soon discovered that they are very limited (oh unless you can download more of course): I added. So, I was hoping to get some advice as to what to do.
Here is a screenshot of the input page, I thought it'd be nice to put things in context:
Basically I need the date and hours fields to be validated against no input and invalid input and I have no idea what to do and what to use. THe date fields should be input in any this format 30/12/2014 or 30/12/2014 or 30.12.2014 or 30/12/14 etc (obviously any advice is accepted) and the hours should be in the range 0-168 (which I could do easily in visual studio with the range validation but then I realized that somehow it had to include the possibility that the field was empty, so I discarded the inbuilt range validation).
Ah, the source code of that page is here, just in case, I don't know
http://pastebin.com/aAfDksUB (Default.aspx)
http://pastebin.com/D8thkAFG (Default.aspx.cs)
Violet_82 89 Posting Whiz in Training
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
Violet_82 89 Posting Whiz in Training
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
Violet_82 89 Posting Whiz in Training
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
Violet_82 89 Posting Whiz in Training
JorgeM 958 Problem Solver Team Colleague Featured Poster
Violet_82 89 Posting Whiz in Training
Violet_82 89 Posting Whiz in Training
mtyide 0 Newbie Poster
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
JorgeM 958 Problem Solver Team Colleague Featured Poster
Violet_82 89 Posting Whiz in Training
Violet_82 89 Posting Whiz in Training
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
Violet_82 89 Posting Whiz in Training
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
Violet_82 89 Posting Whiz in Training
BMXDad 23 Newbie Poster
Violet_82 89 Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.