Open Closed

how to include javascript file in specific view #2225


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> }


3 Answer(s)
  • 0
    ismcagdas created

    Hi,

    You can do it like this,

    @Html.IncludeScript("PathToYourScript")
    
  • 0
    thanapoomc created

    an error showing up

  • 0
    ismcagdas created

    Hi,

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

    @using Abp.Web.Mvc.Extensions