We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Redirect to controller action when appointment clicked

Thread ID:

Created:

Updated:

Platform:

Replies:

118535 Mar 17,2015 03:17 PM Mar 18,2015 08:07 AM ASP.NET MVC 1
loading
Tags: Schedule
Randall Martin
Asked On March 17, 2015 03:17 PM

Can you give me an example of how to setup the scheduler control to redirect to a specific controller action when an appointment is clicked. I need to pass the appointment information to the controller action.

Thanks,
~randy

P.S. Some detailed user guide information on the scheduler would really help. Just sayin...

Sarath Kumar P K [Syncfusion]
Replied On March 18, 2015 08:07 AM

Hi Randall,

Thanks for using Syncfusion products.

We have prepared a sample based on your requirement (“How to setup the scheduler control to redirect to a specific controller action when an appointment is clicked”) and it can be downloaded from the following location.

http://www.syncfusion.com/downloads/support/forum/118535/Localization-641396944.zip

In the above sample, we have used an ajax post within the “AppointmentClick” client side method and it will redirect to the controller action. And in the action method (controller page) we can get the appointment details in the argument (Ex: data).

Index.cshtml:

<code>

@(Html.EJ().Schedule("Schedule1")

.Width("100%")

.Height("600px")

.CurrentDate(new DateTime(2015, 3, 3))

.ScheduleClientSideEvents(eve => eve.Create("onCreate").AppointmentClick("onAppointmentClick")) //Need to mention the appointmentClick client side method

.CurrentView(CurrentView.Day)

.AppointmentSettings(fields => fields.Datasource(ds => ds.URL("Home/GetData").Adaptor("UrlAdaptor"))

.Id("Id")

.Subject("Subject")

.Description("Description")

.StartTime("StartTime")

.EndTime("EndTime")

.AllDay("AllDay")

.Recurrence("Recurrence")

.RecurrenceRule("RecurrenceRule"))

)

<script>

function onAppointmentClick(args) {

//ajax post to call the controller action

$.ajax({

type: "POST",

dataType: 'json',

data: JSON.stringify(args.appointment),

contentType: 'application/json; charset=utf-8',

url: "Home/appointmentClick"

});

}

</script>

</code>

HomeController.cs:

<code>

[HttpPost]

public JsonResult appointmentClick(Appointment data) {

return Json(data);

}

</code>

In controller action we can get the data which is passed from the appointmentClick client side method.

Please refer the below link for detailed user guide information about Schedule.

http://help.syncfusion.com/ug/js/default.htm#!documents/createyourschedulein.htm

Please let us know whether the provided sample helps you and need any further assistance on this.

Regards,

Sarath Kumar P K


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;