Can only use EJ2 on Home/Index, no other views

Hello, I've just gotten started using EJ2. I've added it to an existing MVC project, according to this article:

https://ej2.syncfusion.com/aspnetmvc/documentation/getting-started/visual-studio-2017.html

I can add the control to the Index view of the Home controller, and the app runs fine... 

But, for some reason, I cannot use the controls on any other page. The razor tag @Html.EJS is not recognized.

I must be missing something simple, can you help?

Thanks!

3 Replies

DL Deepa Loganathan Syncfusion Team September 10, 2018 12:43 PM UTC

Hi Jon, 

Thanks for contacting Syncfusion Support. 

We have checked with your query and suspect that you might have created a view page without adding the layout page reference while creating the view page. So, please follow the below steps to create a view and refer the layout page for that view page. 

  1. Right click on the views folder and click add view.
  2. In the dialog box appears, check the use layout page option and refer the _layout page where the script, CSS references and script manager for the EJ2 component are referred as shown in the below screenshot.

 

For your convenience, we have also created a simple sample for rendering the calendar component in newly added page (other than Index.cshtml) and attached it in the below link. Please check it. 


Please let us know if you need any further assistance. 

Regards, 
Deepa L. 
 
 




JO Jon September 10, 2018 03:09 PM UTC

Hello, Well, yes, that seems to have it working now! I must have missed that step!

It's interesting, I only regenerated one set of views, but now the controls seem to work on all pages.

I've also rebooted since I first started working on this, but I wouldn't have expected that to have an effect as I installed all software weeks ago, and I did exit and restart Visual Studio a couple of times to check to see if things just hadn't all loaded correctly.

Oh well, working now, so I can explore the controls fully!

Thank you!


DL Deepa Loganathan Syncfusion Team September 11, 2018 06:30 AM UTC

 
Hi Jon,  
Thanks for the update. 
We are glad to hear that you were able to access Syncfusion HTML helpers across all the view pages.   
Regards,  
Deepa L. 


Loader.
Up arrow icon