How to redirect my ActionMethod (the Url/CrudUrl Method from the dataManager)?

Hi there,


this my scheduler:

<ejs-schedule id="main-scheduler" height="635" cssClass="main-scheduler-cssClass" selectedDate="new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day)">
<e-schedule-views>
<e-schedule-view option="Day"></e-schedule-view>
<e-schedule-view option="Week"></e-schedule-view>
<e-schedule-view option="WorkWeek"></e-schedule-view>
<e-schedule-view option="Month"></e-schedule-view>
<e-schedule-view option="Agenda"></e-schedule-view>
</e-schedule-views>
<e-schedule-eventsettings dataSource="dataManager">
</e-schedule-eventsettings>
</ejs-schedule>

and this is my DataManager:

var dataManager = new DataManager() { Url = "/Scheduler/GetCommunicationRecords", CrudUrl = "/Scheduler/CudOperations", CrossDomain = true, Adaptor = "UrlAdaptor" };

Both GetCommunicationRecords and CrudUrl Methods work fine, i can read/update/create/delete the data from the database.

But when i try to redirect it to another action, it doesn't work! It throws an error in the devConsole:


Like if i want to check if the user is trying to:

1- open a View or PartialView

2- get some data that he shouldn't get

3- ....


I want to redirect the method to the LoginMethod. Like this:

public ActionResult CudOperations()
{
var sessionUsername = HttpContext.Session.GetString("_username");


if (!string.IsNullOrWhiteSpace(sessionUsername))
{
// this is what i want to do
return RedirectToAction("Index", "Login");
}

return Json(// SOMETHING!, it doesn't matter because this point is not going to be triggered);
}

Regards,

Vaiker


1 Reply

BS Balasubramanian Sattanathan Syncfusion Team February 10, 2022 01:28 AM UTC

Hi Vaiker,

Can you please refer to the below link and make sure the redirection code has been added properly at your end? And we have prepared a CRUD sample for your reference. So we would suggest you to replicate the issue in the given sample and share the replication steps to validate further.

Regards,
Balasubramanian S


Attachment: Core_SampleWithService_bcaf8847.zip

Loader.
Up arrow icon