Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I validate that a date selected in a date picker is a Friday?

Posted on 2009-04-14
5
Medium Priority
?
251 Views
Last Modified: 2013-11-26
Greetings Experts,

My users are submitting reports. The status date for the report has two conditions: (1) it cannot be for a previous week and (2) it must be a Friday.

I know how to set a comparison validator on the text field where the date picker puts the selected date (to make sure it's not in the past), but what I cannot figure out for the life of me is how to validate the user's selection is a Friday (and this could change - may become a Monday in the future).

I'm using Visual Studio 2008, with the Ajax Toolkit (from www.asp.net) for the calendar control extender on the text box.

And I'm a noob - so please be gentle with me!  :D

Is there a "visual " way to do this? I've sorta been thrown to the wolves on this one and to be honest wouldn't know how to code if my life depended on it.
0
Comment
Question by:m1cajah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 16

Accepted Solution

by:
burakiewicz earned 375 total points
ID: 24140801
if (DateTime.Parse(TextBox1.Text).DayOfWeek == DayOfWeek.Friday)
                {

                }
0
 

Author Comment

by:m1cajah
ID: 24140831
Hi burakiewicz,

That was fast!  Now... where does that go? It doesn't go in the ASPX page source does it? Or is that "code behind" where I double-click on the text field and it opens a VB file that is used to support that page?

M
0
 
LVL 16

Expert Comment

by:burakiewicz
ID: 24140866
that would go in the codebehind, if you need javascript for the aspx page let me know
0
 

Author Comment

by:m1cajah
ID: 24141939
So I have to have code behind AND javascript on the ASPX page?
0
 
LVL 16

Expert Comment

by:burakiewicz
ID: 24147860
you can have either.  You can do it with code behind server side.  Or you can do it client side with javascript.  These are 2 seperate ways of doing it.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

671 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question