We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

target date is first Sunday from today's date

Medium Priority
178 Views
Last Modified: 2012-05-06
I have a formfield textbox that has a dropdown calendar attached to it.

Here are my questions:
1. How can I autopopulate the first coming sunday in the txt field: Me.txtTargetDate.Text = DateTime.Now.AddMonths(+3).ToString("d"). What do I replace the AddMonths(+3) with?
2. How can I disable all other days (except for Sunday) on the ajax calendar?
or if that's not possibel how can I validate that Sunday are only valid days to be selected?

Thanks  a lot!
Comment
Watch Question

Senior .Net Developer
CERTIFIED EXPERT
Commented:
DateTime.Now.AddDays(7 - DateTime.Now.DayOfWeek)

to validate is sunday:

if DayOfWeek.Sunday.CompareTo(ctype(.txtTargetDate.Text,date))= 0 then
'is sunday.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.