Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
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> }


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

    Hi,

    You can do it like this,

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

    an error showing up

  • 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