calendar control only allows to choose month and year

Posted on 2006-04-03
Last Modified: 2008-03-10
I have an page which let customer choose their request date. But due to business rule, the request date has to be always on the 1st day of calendar month. Basically it means customer could only choose the month and year, not the day. Is there a way to achieve that by using calendar control? Thanks!
Question by:pumaken68
    LVL 5

    Expert Comment

    what's the point with the calendar control then?
    You could instead create two dropdownlists (or one) containing month and year.
    LVL 12

    Accepted Solution

    Use this to show always 1st day of the calendar month chosen.

        Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs)
            Calendar1.SelectedDate = DateSerial(Year(Calendar1.SelectedDate), Month(Calendar1.SelectedDate), 1)
            Calendar1.TodaysDate = DateSerial(Year(Calendar1.SelectedDate), Month(Calendar1.SelectedDate), 1)
        End Sub

    Author Comment

    Thanks Darth_helge, your comment makes sense. That's what we did in ASP. Now converting to, we just want to make use of calendar control as much as possible.

    Thanks bsdotnet, we've achieved what you said using C#.
    But it looks a bit weird. easily confusing customers.
    Are there any calandar control available which only lets you choose month and year?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now