In a partial view I load a javascript file like this :
<script src="@Url.Content("~/Scripts/Testing.js")" type="text/javascript"></script>
In the Testing.js
, there are some functons defined
That's work, the functions defined in the file can be used.
Now I do an action in my application, my controller return an another (where I don't load any js file) partial view. The functions defined in Testing.js
are still available in this partial view.
Is there a way to "remove" the functions loaded in the first view ?
Thanks,
Update 1
I tried this in the partial view but error : The file "~/Views/xxxx.cshtml" cannot be requested directly because it calls the "RenderSection" method.
@section MyScript {
<script src="@Url.Content("~/Scripts/Testing.js")" type="text/javascript"></script>
}
@RenderSection("MyScript", false)
I want to remove functions loaded in the first view
)? – Darin Dimitrov Jul 26 '12 at 7:41