Hi ,
Please suggest a way to display complete calendar for a year using asp.net MVC. I dont want a scheduler. Instead of scheduler, I want to select multiple days from the displayed calendar to save the selected dates to database as holiday for that year.
Saravanan GanesanPosted Sep 24, 2023, 5:05 PM
To display a complete calendar for a year in an ASP.NET MVC application and allow users to select multiple days to save as holidays, you can follow these steps:
Create a Model: Define a model that represents the selected holidays. This model should include properties for the year and a collection of selected dates.
Create a View: Design a view that displays a calendar for the entire year. You can use HTML tables or a JavaScript library like FullCalendar for this purpose.
Populate the Calendar: In the view, dynamically generate the calendar by iterating through the months and days of the selected year. Style the calendar to highlight weekends and other relevant details.
Select Dates: Implement JavaScript to allow users to select multiple dates on the calendar. Highlight selected dates visually.
Submit Selected Dates: When the user submits the selected dates, send them to the server using an AJAX request or a form submission.
Server-Side Handling: In the controller, handle the selected dates and save them as holidays in the database, associating them with the specified year.
Display Holidays: Optionally, you can create another view to display the holidays for the selected year, allowing users to edit or delete them.
Ajay KumarPosted Sep 14, 2023, 11:58 AM
In This Function, You Have to Pass The Year And Get The Full Year Calender.