Results 1 to 6 of 6

Thread: Cannot load javascript file in MVC model

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    211

    Default Cannot load javascript file in MVC model

    hello,

    I use MVC in ASP.NET with user control. Because the usercontrols are loaded dynamically so the path to javascript is changed like below

    Resource interpreted as Script but transferred with MIME type text/html: "http://localhost/abc/page.aspx/en/bbb/process/12485/app/controller/ThreadLists.js?_dc=1339583137852".


    Could I set fixed path for chaque .js file in model, view and control?

    Merci


  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Answers
    102

    Default

    ideally, you want them documented in the requires, stores, views and models arrays so when you go to production, your app will concatenate properly.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    211

    Default

    Thank you for your answer but even I do (in app.js)
    requires: ['Abc.controllers.ThreadLists','Abc.controllers.Organisations'],
    instead of
    controllers: [
    'ThreadLists',
    'Organisations'
    ],
    the error is still there. Is there another solutions?

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    . Because the usercontrols are loaded dynamically
    Are you using any 3rd party JS to load dynamically?

    If this is not the case, then please review the following:
    http://www.sencha.com/learn/the-mvc-...-architecture/

    You may have something wrong.

    Scott.

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    211

    Default

    Hi Scottt,

    You are right. I use a third party platform for .NET. Do you have any solution for this?

    Thanks

  6. #6
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Not off the top of my head .. I am not that familiar with using .NET .. you may have to see if they have a config setting to account for this.

    Scott.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •