Base solution for your next web application
Open Closed

how to include javascript file in specific view #2225


User avatar
0
thanapoomc created

how to include javascript file in specific view not in AppBundleConfig (SPA angularJS) i was trying to put script in createOrEditModal.cshtml view however it doesn't work

@section JavaScript { <script type="text/javascript" src="@Url.Content("/Scripts/SomeScript.js")"></script> }

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can do it like this,

    @Html.IncludeScript("PathToYourScript")
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    thanapoomc created

    an error showing up

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you try to add this line on top of your cshtml file ?

    @using Abp.Web.Mvc.Extensions
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)