I have a base page , and all the pages are inherited from it . and different pages would load some external js files individually. Let's say one of these pages AddUser.aspx
.
public class BasePage : System.Web.UI.Page {
....
}
public partial class AddUser : BasePage {
....
}
After AddUser.aspx
is rendered. The html content of it shows some js files would be included like below.
<script src="a.js" type="text/javascript"></script>
<script src="b.js" type="text/javascript"></script>
<script src="c.js" type="text/javascript"></script>
<script src="d.js" type="text/javascript"></script>
...
I want to register an external js file before all these js file. Let's say it is named firstrun.js
and make sure firstrun.js
always firstly run before other js files in all the page.
the desired result like below.
<script src="firstrun.js" type="text/javascript"></script>
<script src="a.js" type="text/javascript"></script>
<script src="b.js" type="text/javascript"></script>
<script src="c.js" type="text/javascript"></script>
<script src="d.js" type="text/javascript"></script>
...
Is there any workaround in the base page ? thanks.