[CLOSED] "ResourceManager is not defined in the View" at the first load

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] "ResourceManager is not defined in the View" at the first load

    Hi,

    I have problem in my deployment server.
    When I install website in IIS, and start, it shows: "Probably ResourceManager is not defined in the View".
    This happens only at the first time I load the page after restart IIS, or change application pool, or after longtime unused.

    Do you have any idea to resolve this problem.
    Is there any configuration in IIS I have to setup?
    Thanks in advance
    Last edited by geoffrey.mcgill; Feb 11, 2016 at 5:37 PM.
  2. #2
    Hi @UnifyEducation,

    Unfortunately, we have no idea. Please demonstrate the View and the Controller Action which renders that View.
  3. #3

    I have the same issue

    Hi Daniil, I have the same issue, I noticed a repeating pattern on the forums where people ask for a question and they you reply with give an example and the person leaves and the thread is just abandoned.

    Actually it renders the forum quit useless today alone I have hit 10 threads where they simply end with you asking for an example.

    So in an effort to provide an example to help you narrow down to the issue here is my code

    controller
     public class EmployeeSearchController : Controller
        {
            //
            // GET: /EmplyeeSearch/
            public ActionResult Index()
            {
                return View();
            }
    
            [HttpPost]
            public ActionResult SearchEmployees(EmployeeSearchVM x)
            {
                ECIS.BLL.EmployeeJobBLL bll = new ECIS.BLL.EmployeeJobBLL();
                List<EmployeeJob> empJobs = bll.SearchEmployees(x.SearhParams.EmployeeNum, x.SearhParams.OrgCode, x.SearhParams.FirstName, x.SearhParams.LastName);
                return PartialView("_EmployeeSearchResults", empJobs);
            }
    
            public ActionResult GetData(EmployeeSearchVM x)
            {
                ECIS.BLL.EmployeeJobBLL bll = new ECIS.BLL.EmployeeJobBLL();
                List<EmployeeJob> empJobs = bll.SearchEmployees(x.SearhParams.EmployeeNum, x.SearhParams.OrgCode, x.SearhParams.FirstName, x.SearhParams.LastName);
                return this.Store(empJobs);
            }     
    	}
    main search view
    
    @model ECIS.UI.Models.EmployeeSearchVM
    
    
    @{
        ViewBag.Title = "Employee Search";
    }
    
    <link href="~/Content/JQueryGrid/grid-0.5.6.min.css" rel="stylesheet" />
    
    @*<link href="~/Content/bootstrap-theme.min.css" rel="stylesheet" />*@
    
    <script src="~/Scripts/Grid/grid-0.5.6.min.js"></script>
    
    
    @using (Ajax.BeginForm("SearchEmployees", "EmployeeSearch", new System.Web.Mvc.Ajax.AjaxOptions { UpdateTargetId="DivSearchResults" })) //, new { @class = "form-horizontal", role = "form" }))
    {
    
        <br />
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">Employee Search Parameters</h3>
                </div>
                <div class="panel-body">
                    <div class="row">
                        <div class="form-group col-md-3">
                            @Html.LabelFor(m=>m.SearhParams.EmployeeNum)
                            @Html.TextBoxFor(m => m.SearhParams.EmployeeNum, new { @class = "form-control", @Id = "EmployeeNumberSearch" })
                        </div>
                        <div class="form-group col-md-3">
                            @Html.LabelFor(m => m.SearhParams.OrgCode)
                            @Html.TextBoxFor(m => m.SearhParams.OrgCode, new { @class = "form-control", @Id = "OrgCodeSearch" })
                        </div>
                        <div class="form-group col-md-3">
                            @Html.LabelFor(m => m.SearhParams.FirstName)
                            @Html.TextBoxFor(m => m.SearhParams.FirstName, new { @class = "form-control", @Id = "FirstNameSearch" })
                        </div>
                        <div class="form-group col-md-3">
                            @Html.LabelFor(m => m.SearhParams.LastName)
                            @Html.TextBoxFor(m => m.SearhParams.LastName, new { @class = "form-control", @Id = "LastNameSearch" })
                        </div>
                    </div>
                    <div class="row">
                        <div id="divShowActionbtn" class="form-group col-md-12">
                            <button type="submit" id="btnSearch" class="btn btn-default">Search</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    
    }
    
    <div id="DivSearchResults"></div>
    partial view to fit inside the DivSearchResults

    @model IEnumerable<ECIS.Model.EmployeeJob>
    
    
    <script>
    
        var EmployeeRenderer = function (value, p, record) {
    
    
            var empNum = record.data.Employee.EmployeeNumber;
            var jobSuf = record.get("JobSuffix");
            var PosNum = record.get("PositionNumber");
    
            var params = {
                PositionNumber: PosNum,
                JobSuffix: jobSuf
            };
            var url = "<a href=\"././Employee/EmployeeDetails/" + empNum + "?" + $.param(params) + "\" class=\"btn-link\" style=\"color:blue\">" + empNum + "</a>";
            // console.log();
            return url;
        };
    
        var EmployeeNameRenderer = function (value) {
            return value.EmployeeFullName;
        };
    
        var onComboBoxSelect = function (combo) {
            var store = combo.up("gridpanel").getStore();
            store.pageSize = parseInt(combo.getValue(), 10);
            store.reload();
        };
    </script>
    
    <br /><br />
    <a class="btn-link">asdfasdfasdv</a>
    
    <br /><br />
    @(Html.X().GridPanel()
            .Title("Array Grid")
            .Width(1200)
            .Store(
                Html.X().Store().ID("Store1").Model(Html.X().Model()
                        .Fields(
                            new ModelField() { Name = "Employee", Type = ModelFieldType.Object },
                            new ModelField() { Name = "Employee", Type = ModelFieldType.Object },
                            new ModelField("PositionNumber"),
                            new ModelField("JobSuffix"),
                            new ModelField("JobTitleDesc"),
                            new ModelField("EmployeeOrgCode")
                        )
    
                        .IDProperty("Employee.EmployeeNumber,PositionNumber,JobSuffix")
                )
                .DataSource(Model)
                .ServerProxy(Html.X().AjaxProxy().Url(Url.Action("GetData", "Test")))
                .PageSize(10)
                )
    
    
                .ColumnModel(
            //Html.X().RowNumbererColumn().Width(50),
                Html.X().Column().Text("Employee Number").DataIndex("Employee").Width(200).Renderer("EmployeeRenderer"),
                Html.X().Column().Text("Employee Name").DataIndex("Employee").Width(300).Renderer("EmployeeNameRenderer"),
                Html.X().Column().Text("Position Number").DataIndex("PositionNumber").Width(125).Renderer(RendererFormat.None),
                Html.X().Column().Text("Job Suffix").DataIndex("JobSuffix").Width(125),
                Html.X().Column().Text("Job Title Desc").DataIndex("JobTitleDesc").Width(200),
                Html.X().Column().Text("Org. Code").DataIndex("EmployeeOrgCode").Width(200)
            )
            .SelectionModel(
                Html.X().RowSelectionModel().Mode(SelectionMode.Multi)
            )
            .View(Html.X().GridView().StripeRows(true))
            .BottomBar(
                Html.X().PagingToolbar()
                    .Items(
                        Html.X().Label("Page size:"),
                        Html.X().ToolbarSpacer(10),
                        Html.X().ComboBox()
                            .Width(80)
                            .Items("1", "2", "10", "20")
                            .SelectedItems("10")
                            .Listeners(l =>
                            {
                                l.Select.Fn = "onComboBoxSelect";
                            })
                    )
                    .Plugins(Html.X().ProgressBarPager())
            )
    
    )

    fully exception text

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>
    
                      </td>
                   </tr>
                </table>
    
                <br>
    
                <b>Stack Trace:</b> <br><br>
    
                <table width=100% bgcolor="#ffffcc">
                   <tr>
                      <td>
                          <code><pre>
    
    [Exception: Probably ResourceManager is not defined in the View]
       Ext.Net.ExtNetTransformer.Transform(String text) +162
       Ext.Net.InitScriptFilter.Transform() +77
       Ext.Net.InitScriptFilter.Flush() +47
       System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr) +9646489
       System.Web.HttpResponse.FilterOutput() +104
       System.Web.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +49
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +69
    </pre></code>
    
                      </td>
                   </tr>
                </table>
    
                <br>
    
                <hr width=100% size=1 color=silver>
    
                <b>Version Information:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34209
    
                </font>
    
        </body>
    </html>
    <!-- 
    [Exception]: Probably ResourceManager is not defined in the View
       at Ext.Net.ExtNetTransformer.Transform(String text)
       at Ext.Net.InitScriptFilter.Transform()
       at Ext.Net.InitScriptFilter.Flush()
       at System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr)
       at System.Web.HttpResponse.FilterOutput()
       at System.Web.HttpApplication.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System

    shared layout

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>@ViewBag.Title - @ECIS.UI.Resources.Global.Title</title>
        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")
        @Scripts.Render("~/bundles/jquery")
    
        @Scripts.Render("~/bundles/bootstrap")
      	
        <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
        
        @RenderSection("headtag", false)
    
        
    </head>
    <body>
        @Html.X().ResourceManager(ViewBag.ManagerConfig as MvcResourceManagerConfig)
        <nav class="navbar navbar-default navbar-fixed-top">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    @Html.ActionLink(@ECIS.UI.Resources.Global.Title, "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li>@Html.ActionLink("Dashboard", "Index", "Dashboard")</li>
                        <li>@Html.ActionLink("Employee Search", "Index", "EmployeeSearch")</li>
                        <li>@Html.ActionLink("Home", "Index", "Home")</li>
                        <li>@Html.ActionLink("User Admin", "Index", "UserAdmin")</li>
                        <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
                    </ul>
                    <p class="nav navbar-text navbar-right">Hello, @User.Identity.Name!</p>
                </div>
            </div>
        </nav>
    
    
        <div class="container body-content">
            @RenderBody()
            <hr />
            <footer>
                <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>
            </footer>
        </div>
    
        
        @Scripts.Render("~/bundles/bootstrap")
        @RenderSection("scripts", required: false) 
    
    </body>
    </html>
  4. #4
    Hello,

    We really appreciate you providing a sample, although I don't think the sample will work. There are external dependencies that will throw exceptions.

    Can you simplify the sample to remove all code that is not directly related to reproducing the problem?
    Geoffrey McGill
    Founder
  5. #5
    Hi I provided the error, do you mean that the error is too generic and that even with all the code i provided you would not be able to determine or take a guess at what could be causing it?

    It sounds to me that it's looking for something this code works great when i use a test controller and an index.cshtml view but once i move the same code to a partial view i start getting the error. I moved the " @Html.X().ResourceManager(ViewBag.ManagerConfig as MvcResourceManagerConfig)" directly into the partial view and not i have a slightly different error.

    The issue is not the code the issue has to do with the structure i'm using controller > ajax > partial view.

    can you please have a look at the code i posted assume that the grid and all the code works because it does.

    thanks,
    Bilal
  6. #6
    could it maybe have anything to do with an EXT.Net mvc feature that you guys implemented such as PartialViewResult?

    Does that ring a bell at all? I saw another thread stating that you cannot use regular partial view rendering with ext.net is that true?

    Thanks,
    Bilal
  7. #7
    Is the GridPanel require to reproduce the Exception?

    I'm also assuming the inclusion of .js and .css files are not required either?

    Remove all code that is not directly related to reproducing the problem will help all of us understand and reproduce the error. If we need to piece together some abstract sample based on a description, we're likely not going to invest the time trying to figure out how to reproduce.
    Geoffrey McGill
    Founder
  8. #8

    I hope this is simple enough

    so here is a simple example can you now tell me if partial views work the same way in ext.net please? it's 7pm everyone is gone home i'm here just waiting for some help.

    controller
    namespace ECIS.UI.Controllers
    {
        public partial class TestController : Controller
        {
    
            public ActionResult index()
            {
                return View();
            }
    
    
            public ActionResult Search()
            {
                string str = "abc";
                return PartialView("_TestPartialView", str);
            }
        }
    }
    index view
    @model string
    <br /><br />
    @using (Ajax.BeginForm("Search", "Test", new System.Web.Mvc.Ajax.AjaxOptions { UpdateTargetId = "DivSearchResults" })) //, new { @class = "form-horizontal", role = "form" }))
    {
        <button type="submit" id="btnSearch" class="btn btn-default">Search</button>
    }
    <br />
    <div id="DivSearchResults"></div>
    partial view
    @model System.String
    
    @(Html.X().Label().Text("Hello World"))
  9. #9

    Found a solution

    Hi have decided to discontinue using ext.net tools, Thank you for your help and best of luck to your team.
    Last edited by Bilal; Feb 11, 2016 at 6:27 PM.
  10. #10
    Hi @Bilal,

    Thanks for the status update, and best of luck with your future projects.

    Just to finish off this thread, I was able to reproduce the issue based on the last simplified sample from @Bilal.

    Running the code, I received the following Exception:

    Click image for larger version. 

Name:	Screenshot 2016-02-11 11.45.21.jpg 
Views:	111 
Size:	101.1 KB 
ID:	24425

    The error message is:

    Probably ResourceManager is not defined in the View
    I took another look at the TestPartialView.cshtml and noticed the Ext.NET ResourceManager had not been defined in the View. Once I added the ResourceManager to the View, the sample worked perfectly.

    Here's the PartialView code I tested:

    Before

    @model System.String
    
    @(Html.X().Label().Text("Hello World"))
    After

    @model System.String
    
    @(Html.X().ResourceManager())
    
    @(Html.X().Label().Text("Hello World"))
    Hope this helps someone in the future.
    Geoffrey McGill
    Founder
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 13
    Last Post: Dec 05, 2012, 9:39 AM
  2. Replies: 3
    Last Post: Mar 22, 2012, 7:46 AM
  3. Replies: 2
    Last Post: Jun 26, 2011, 1:59 AM
  4. Replies: 11
    Last Post: Mar 30, 2011, 2:21 PM
  5. Replies: 0
    Last Post: Mar 29, 2011, 5:32 PM

Posting Permissions