PDA

View Full Version : [CLOSED] Component rendered before initialization scripts using placeholder with ResourceMode.Script with MVC



anup
Nov 20, 2013, 10:06 AM
The following seems to only be an issue with MVC when using ResourceMode.Script. I am finding that the Statusbar component has its initialization script written to the head before the rest of the Ext.NET initialization scripts, resulting in JavaScript errors (Ext is not defined, because Statusbar JS is using it before the Ext.NET initialization scripts have loaded).

I spent ages trying to reproduce this in a cut down example (thinking Viewport had something to do with it!) but Daniil was able to provide the simplest case of all!



@{
var X = Html.X();
}

<!DOCTYPE html>
<html>
<head>
<title>ResourcePlaceHolder ResourceMode.Script test</title>

@X.ResourcePlaceHolder(ResourceMode.Script)
</head>
<body>
@X.ResourceManager()

@X.StatusBar()
</body>
</html>


Note

If you change ResourceMode to ResourceMode.ScriptFiles, then it is okay.
We have found this to be the case for Statusbar, I am not sure if others are affected (most others I have tried seem fine)
This could be related to this thread, but I am not sure: http://forums.ext.net/showthread.php?27271-Error-with-ResourcePlaceholder-for-scripts-in-MVC-Reference-token-%28ext-net-initscriptfiles%29-was-not-found

Vladimir
Nov 20, 2013, 10:48 AM
Hi

Thanks for the report. Fixed in SVN

anup
Nov 20, 2013, 6:49 PM
Many thanks for the quick turnaround. Works nicely now.