Reputation: 3020
I'm trying to use Script# 0.7 with MVC 3 using the ScriptSharpSection and all that stuff. So far I'm doing
@{ Ajax.InitializeScripts();
}
but I get the exception: "The referenced script named 'loader' was not registered in configuration as a script."
I can bypass that exception adding a <script name="loader" ... but I don't know that scripts has to do.
Is there any example showing how this is done? Thanks.
Upvotes: 0
Views: 570
Reputation: 5225
I still need to get examples out.
Does your web.config have this:
<configSections>
<section name="scriptSharp" type="ScriptSharp.Web.Configuration.ScriptSharpSection, ScriptSharp.Web"
allowDefinition="MachineToApplication" requirePermission="false" />
</configSections>
...
<scriptSharp clientScriptStorageCookie="scripts">
<script name="loader" url="/Content/Scripts/ssloader.js" version="0.7" />
<script name="loader.debug" url="/Content/Scripts/ssloader.debug.js" version="0.7" />
<script name="core" url="/Content/Scripts/mscorlib.js" version="0.7" />
<script name="core.debug" url="/Content/Scripts/mscorlib.debug.js" version="0.7" />
<script name="jquery" url="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" />
<script name="jquery.debug" url="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js" />
</scriptSharp>
And do you have the ssloader.js script to go along with it?
The MVC APIs render out scripts that are then downloaded by the script loader while managing dependency order etc. For now it is required. Eventually I need to add couple of things:
Hope that explains the current implementation and what will be added in the future to make ssloader.js optional.
Upvotes: 1