Example needed

Peter_1985 2,691 Reputation points
2021-09-14T04:55:21.48+00:00

Hi,
Further to details below, is there one example to prompt the Calendar due to one click to a date field?

<asp:Calendar ID="Calendar1" runat="server" SelectedDate="<%# DateTime.Today %>" />

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,682 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,541 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Yijing Sun-MSFT 7,086 Reputation points
    2021-09-14T08:45:41.04+00:00

    Hi @Peter_1985 ,

    Could you tell us your date filed? Assume you have a textbox as the date field, you could try to use jquery datepicker to prompt the calendar.Just like this:

    131856-image.png
    Note: You must add jquery-ui jquery package.


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Yijing Sun

    0 comments No comments

  2. Peter_1985 2,691 Reputation points
    2021-09-14T08:59:46.957+00:00

    I put the code and cannot show the picker. What to adjust below?
    131828-3g.png


  3. Peter_1985 2,691 Reputation points
    2021-09-20T07:09:30.877+00:00

    Can you advise if field (in red) below should not be name of Textbox?
    133418-4g.png

    0 comments No comments

  4. Yijing Sun-MSFT 7,086 Reputation points
    2021-09-22T06:26:57.513+00:00

    Hi @Peter_1985 ,
    That was not what I meant. I tried your codes and debug it for pressing F12. And then I get the error message of "Uncaught TypeError: $(...).datepicker is not a function(anonymous function)". I'm guessing that you have the same error message. The reason is the jquery file and jquery-ui file wrong. You need higher version of the jquery file and jquery-ui file.Just like this:
    134196-capture11.png
    Best regards,
    Yijing Sun


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.