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.
Syncfusion Feedback

Redirect to controller action with Event Id on the click event of the appointment.

Thread ID:

Created:

Updated:

Platform:

Replies:

128293 Jan 12,2017 05:00 PM UTC Jan 13,2017 03:15 PM UTC ASP.NET Core 1
loading
Tags: Schedule
Keith
Asked On January 12, 2017 05:00 PM UTC

I am populating a scheule with meetings that are added via a seperate windows application, I will not be enabling the any CRUD options in the schedule.

I wish to redirect to a controller action when the appointment is clicked, and only require the Id of the appointment for further use. I have read a few other articles and have tried using them (see code below) however as i only need the event Id i was hoping for a simpler way to pass the Id only (maybe something like --

window.location.rel='nofollow' href = "@Url.Action("OrderPaper", "DocumentProduction")?eventID=" + event.BookingID;


Thanks


View:

<div>

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

.Width("100%")

.Height("525px")                              

.ReadOnly(true)

.ScheduleClientSideEvents(eve => eve.Create("onCreate")

.AppointmentClick("onAppointmentClick")

.CellClick("onCellClick")

.AppointmentWindowOpen("onAppointmentWindowOpen"))

.AppointmentSettings(fields => fields.Datasource((IEnumerable<object>)ViewBag.dataSource)

.Id("Id")

.Subject("Subject")

.StartTime("StartTime")

.EndTime("EndTime")

.Description("Description")

.AllDay("AllDay")

.Recurrence("Recurrence")

.RecurrenceRule("RecurrenceRule"))

.Render();

} 

</div>


<script language="javascript" type="text/javascript">

 function onCellClick(args) {

 args.cancel = true;
}


 function onAppointmentWindowOpen(args) {

 args.cancel = true;
}


function onCreate(args) {


}


function onAppointmentClick(args) {

//ajax post to call the controller action

$.ajax({

 type: "POST",
 data: JSON.stringify(args.appointment),
 contentType: 'application/json; charset=utf-8',

//url: "DocumentProduction/OrderPaper",
 url: "@(Url.Action("OrderPaper", "DocumentProduction"))"

});


Controller:

[HttpPost]
public JsonResult OrderPaper(Appointment data)
{

 return Json(data);
}














}


</script>



Sellakumar [Syncfusion]
Replied On January 13, 2017 03:15 PM UTC

Hi Keith, 
  
Thank you for contacting Syncfusion support. 
  
We have prepared the sample to meet your requirement based on the given code example, which can be download from the below location. 
 
  
Kindly revert us, if you need any further assistance. 
  
Regards, 
Sellakumar 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.

Warning Icon 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.Close Icon

;