The error Uncaught TypeError: $(...).ej< component > is not a function arises when referring to the JQuery scripts multiple times in the corresponding web application or when jQuery script files are referred to after the Syncfusion script files, ej.web.all.min.js and ej.webform.js.min. The following screenshot shows the error occurs in the dialog component.
Figure 1: Uncaught TypeError: $(...).ejDialog is not a function error
To overcome this error, refer to the jQuery scripts in the application only once or refer to the Syncfusion specific script files after the jQuery file reference. The following are the solutions:
Solution 1
Create a web application in Visual Studio and the jQuery scripts configure automatically in the ScriptManager section. In case of using the script, references generated from the VS project creation under ScriptManager, add the manual references to other dependent scripts for rendering control after the jQuery base reference. Syncfusion has added references to the required files in the Site.Master page under the ScriptManager. Refer to the following code:
Site.Master
Solution 2
Add the Syncfusion scripts and jQuery scripts in bundle configuration in the App_Start folder and refer to the bundles in the Site.Master page. Refer to the following code for bundleconfig and references.
BundleConfig.cs
SiteMaster
Note: Make sure that there are no other references for jQuery file and Syncfusion script files in any other pages. Use these dependent scripts on SiteMaster page.
In case the requirement is to refer on individual pages, make sure that there is no conflict of multiple references when the page loads. By default, when creating an application or website using Visual Studio the script reference for jQuery file will be added in the ScriptManager.
This solution is applicable for both ASP.NET WebForms and ASP.NET MVC. |
Article ID: | Published Date: | Last Revised Date: | Platform: | Control: |
9197 | 08/21/2018 | 08/27/2018 | ASP.NET MVC | General |
or the page will be automatically redirected to sign-in page in 10 seconds.