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. Image for the cookie policy date

Regarding running the example for Gantt control

Hi.
I try to test your example for the Gantt control in Visual Studio:
https://ej2.syncfusion.com/aspnetmvc/documentation/gantt/getting-started/


but I run into some issues:

I have added the using to the top of the Index file like so:

@using Syncfusion.EJ2
@{
    ViewBag.Title = "Home Page";
}

but I get the error:


Error CS0234 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)

Error CS0103 The name 'ViewBag' does not exist in the current context

And adding this to the bottom of the file:

    @Html.EJS().Gantt("Gantt").DataSource((IEnumerable)ViewBag.DataSource).Height("450px").TaskFields(ts => ts.Id("TaskId").Name(
    "TaskName").StartDate("StartDate").EndDate("EndDate").Duration("Duration").Progress("Progress").Child("SubTasks")).Render()

Gives me the error


Error CS1929 'HtmlHelper' does not contain a definition for 'EJS' and the best extension method overload 'HtmlMVCExtension.EJS(HtmlHelper)' requires a receiver of type 'HtmlHelper'

Tommy




1 Reply 1 reply marked as answer

KR Karthikeyan Raja Syncfusion Team November 19, 2020 12:02 PM UTC

Hi Tommy,

Thanks for contacting Syncfusion support.
We have analyzed your query and We have prepared a Gantt sample in ASP.NET MVC application. Please find the sample from below link
Sample - https://www.syncfusion.com/downloads/support/directtrac/general/ze/MVC_latest-466662050
For further details you can refer the below documentation link,
Documentation  - https://ej2.syncfusion.com/aspnetmvc/documentation/gantt/

Please get back to us, If you need any further assistance.
 
  
Regards,
Karthikeyan Raja
 


Marked as answer
Loader.
Live Chat Icon For mobile
Up arrow icon