calander control on a web form

Posted on 2005-05-02
Last Modified: 2008-03-03
I have a web form created with

on the form is a calander control

 a user clicks the calander date on  the web form , the date changes and then clicks on a submit button to start  a query..... it works great..... however, if the user does not click the on the calander( they assume the highlighted date is the default), and clicks on the submit button  the query crashes. I inserted a breakpoint to watch the flow and noticed the calander date is " 12:00AM" unless ithe calander has been clicked.....then its a valid date

any assistance will be appreciated

Question by:stephenz43
    LVL 9

    Expert Comment


    you have to set the date in the calander on the first load of the webpage with DateTime.Now for example because there is no default date set with the control.

    Hope this helps.

    Author Comment


    I tried it, but when I try to change the date by clicking, the date always remains to the value sent in the load event....

    ( im a rookie )

    LVL 9

    Accepted Solution

    Do you use If Not Page.IsPostback or if !Page.IsPostback in Page_Load event to set Default value of the calander. If no, try.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Article by: jpaulino
    XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String ( Literal, only instead of starting and ending with w…
    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    737 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

    20 Experts available now in Live!

    Get 1:1 Help Now