Nov 18, 2013, 3:53 PM
[CLOSED] Error with ResourcePlaceholder for scripts in MVC: Reference token (ext.net.initscriptfiles) was not found.
Hi,
I have latest code, and a simple test MVC view:
I have latest code, and a simple test MVC view:
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<title>Resource placeholder test</title>
@Html.X().ResourcePlaceHolder(ResourceMode.Style)
@Html.X().ResourcePlaceHolder(ResourceMode.Script)
</head>
<body>
@Html.X().ResourceManager()
<p>Test</p>
</body>
</html>
The controller is this:using System.Web.Mvc;
namespace Ext.Net2.Tests.Controllers
{
public class ResourcePlaceholderTestController : Controller
{
//
// GET: /ResourcePlaceholderTest
//
public ActionResult Index()
{
return View();
}
}
}
When I run this page I get the following error:ItemTag validation (_tkn_1): Reference token (ext.net.initscriptfiles) was not found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception: ItemTag validation (_tkn_1): Reference token (ext.net.initscriptfiles) was not found.
Source Error:
Line 137: }
Line 138:
Line 139: throw;
Line 140: }
Line 141: }
Source File: d:\Ext.Net\2.x\Ext.Net\Core\ExtNetTransformer.cs Line: 139
Stack Trace:
[Exception: ItemTag validation (_tkn_1): Reference token (ext.net.initscriptfiles) was not found.]
Transformer.NET.ItemTag.Validate() +156
Transformer.NET.TextTransformer.Handle() +159
Transformer.NET.TextTransformer.Transform(List`1 tokensType, Dictionary`2 variables) +28
Transformer.NET.TextTransformer.Transform(List`1 tokensType) +11
Transformer.NET.TextTransformer.Transform() +27
Ext.Net.ExtNetTransformer.Transform(String text) in d:\Ext.Net\2.x\Ext.Net\Core\ExtNetTransformer.cs:139
Ext.Net.InitScriptFilter.Transform() in d:\Ext.Net\2.x\Ext.Net\Core\InitScriptFilter.cs:69
Ext.Net.InitScriptFilter.Flush() in d:\Ext.Net\2.x\Ext.Net\Core\InitScriptFilter.cs:57
System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr) +9684129
System.Web.HttpResponse.FilterOutput() +104
System.Web.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +49
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
The CSS resources placeholder is fine; it is just the JavaScript placeholder that doesn't work. If I comment out or remove this line, then the error goes away:@Html.X().ResourcePlaceHolder(ResourceMode.Script)
If it helps, I also created a new project and installed the latest Ext.NET.MVC Package from NuGet, and edited the Ext.NET razor view to insert the two resource placeholders, and got the same error.
Last edited by Daniil; Nov 22, 2013 at 10:31 AM.
Reason: [CLOSED]