0

Hi people I having a slight problem I looking for the simplest way of using a calendar control in MVC3 asp.net C#. I have played around with MVC3 C# could not get the calender control to work I tried to hand write the code but i failed. I tried to find for some ASP.net examples did not succeed. The way i want to use the calendar is, when a user clicks on a date he or she is able to input information and it gets stored within a database. Is this possible to do? if so are there any examples out there that i may have missed or code that you could start me off to create a fresh one. I have been at this for nearly 2 months and deleted many tries since they did not work.

Thank You

8
  • I have tried the following: asp.net/mvc/tutorials/javascript/… antiyes.com/aspnet-mvc-calendar-helper weblogs.asp.net/gunnarpeipman/archive/2010/02/03/… But i know you just going to ask so you know am just not asking for free code and then not reply it happened to me before mvc.daypilot.org/… Commented Jan 21, 2012 at 20:29
  • I knew you were going to do that ask me a question and when you got the answer and just vanish. If you were not going to help why ask a question? Commented Jan 21, 2012 at 21:04
  • If you were going to ask a question, why not add all relevant details? An accurate description of what you really want wouldn't hurt either. See the confusion below. Appointment texts are not really part of calendar controls, and neither is updating any database. Commented Jan 21, 2012 at 21:06
  • Yes they are, if you would have read the question properly maybe you would understand. "The way i want to use the calendar is, when a user clicks on a date he or she is able to input information and it gets stored within a database. Is this possible to do?" Commented Jan 21, 2012 at 21:12
  • Appointment was a example of what i have written: "when a user clicks on a date he or she is able to input information and it gets stored within a database. Is this possible to do?" "information" can be anything. An example of Appointments was there to show what "information" could stand for? Commented Jan 21, 2012 at 21:15

3 Answers 3

3

You could use a client side calendar. jQuery UI DatePicker is a good choice. It supports lots of functions including inline display.

Sign up to request clarification or add additional context in comments.

7 Comments

Just visualize a calendar on a cshtml page and when you run the application, you click on a date from the calendar and then a input box appears and you insert some text such as a appointment for example. Just say you click on the 2nd of march and a input box appears and you write I have an appointment to see a doctor.
@user1137472, great, seems very easy. The jQuery UI datepicker could be perfect for this scenario. You could subscribe to the onSelect event which will be trigerred when the user selects a date so that you could toggle the visibility of some text input or whatever action you want to perform.
But that is the other-way around to what i wanted the input box picks the date and puts it inside the input box not the date showing the input box. Thanks for your help It seems there is not a way to do this as the example you gave me no where does it show a calender where i can select a date and input box appears it is the input box showing the date. Thanks anyways
@user1137472, you could associate the jQuery UI datepicker to a hidden input field if you don't want an input field to be visible but only a button. Here's an example: stackoverflow.com/a/1127215/29407
To complex for me just want to select a date and input some information but thanks anyways
|
2

Do you mind to use a jQuery plugin?

Give FullCalendar a try.

Then you can easily create an action to fill up the appointments as well to grab the new ones created by the user, every thing works with ajax calls, so in MVC is really easy to accomplish this.

Let me know if you have trouble using this.

4 Comments

I have seen this but it will let you click on the date and input what information this is a control for moving tags around on date nothing is stored within a database a date can not be selected
You are wrong, you can click on a day and show an input form, just use the dayClick event
here is an example on how to create events, you have total control on what you can do, it's all up to you. You can simply show a modal dialog with a form
Where do i download the one you have total control on
1

Have you tried the Telerik ASP.NET MVC controls (they have a calendar of course)?

They are dual licensed (commercial license and GPL). They usually have pretty good controls and build it upon jQuery, so it's easy to understand and extend if you need to.

2 Comments

They are not free you have to pay
Only if you can't live with the GPLv2 licensed version (telerik.com/products/aspnet-mvc/getting-started/licensing.aspx). And where did you say that it need to be free? If you are not coding for a living I'm pretty sure that GPLv2 is okay for you. If you are coding for a living it shouldn't be a problem to invest some money in your tools.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.