[CLOSED] SetResources method

Page 2 of 2 FirstFirst 12
  1. #11
    Hi Vladimir,

    Thank you very much. But how can I use resources from cdn server for dynamic control?
  2. #12
    Hi,

    Dynamic controls doesn't work with resources from other domains because we cannot download it using ajax request (even if we render script tags then we have no ability to track when cross domain resources will be loaded, we have to track resource loading because response script must executed after resource loading). At this moment, only webresources are supported

    I can suggest to preload all required resources from cdn manually during initial page load
  3. #13
    Hi Vladimir,

    Thank you very much. But I make a cheat as below:

    In Resource property, I try to register script and style includes
          protected override System.Collections.Generic.List<ResourceItem> Resources
          {
             get
             {
                this.ResourceManager.RegisterClientScriptInclude("test",
                                                                 this.Page.ClientScript.GetWebResourceUrl(typeof(ServerControl1), "ExtControls.test.js"));
                this.ResourceManager.RegisterClientStyleInclude("styletest",
                                                                 this.Page.ClientScript.GetWebResourceUrl(typeof(ServerControl1), "ExtControls.CSS.css"));
                return base.Resources;
             }
          }
    And I see that the script registering is working while the style registering is not working
    "Ext.net.append(Ext.get('aspnetForm'),["<div id=\"ctl00_ContentPlaceHolder1_EditPlaceHolder_Content\" class=\"x-hidden\">"," <div id=\"ctl00_ContentPlaceHolder1_dyn_test_Container\">","</div></div>"].join(''));Ext.net.ResourceMgr.load([{url:"/UpdateContent10/WebResource.axd?d=lE-b86YXCKTXkXf5Uox2em-LK4NOarC4bFkAi-Srz5fethSiEDlLs7_C785W6S-yMP7hcj6pvMTAMBwq-SxvWIkw2wjyV0F0fGL6irogwsGW2w7Pz-Tc-Xxyjbuvs0LE0&t=634467728882490802"}], function(){ctl00_ContentPlaceHolder1_hidden.setValue("loaded");Ext.net.ResourceMgr.destroyCmp("ctl00_ContentPlaceHolder1_EditPlaceHolder");ctl00_ContentPlaceHolder1_kaka.addAndDoLayout({id:"ctl00_ContentPlaceHolder1_EditPlaceHolder",contentEl:"ctl00_ContentPlaceHolder1_EditPlaceHolder_Content",bodyBorder:false,border:false});new extctrl({id:"ctl00_ContentPlaceHolder1_dyn_test",renderTo:"ctl00_ContentPlaceHolder1_dyn_test_Container"});});"
    Could you please explain to me why the registering of style is not registered?
  4. #14
    Hi,

    why do you close my thread? there is still one question left.
  5. #15
    It was marked as closed by mistake.

    Please see how, for example, Panel's .Resources looks:

    Example

    protected override List<ResourceItem> Resources
    {
        get 
        {
            List<ResourceItem> baseList = base.Resources;
     
            if (this.RegisterAllResources || this.FormGroup)
            {
                baseList.Capacity += 1;
    
                baseList.Add(new ClientStyleItem(typeof(Panel), "Ext.Net.Build.Ext.Net.ux.extensions.formgroup.css.formgroup-embedded.css", "/ux/extensions/formgroup/css/formgroup.css"));
            }
    
            return baseList;
        }
    }
    I think you should going this way - add a resource to base.Resources.
  6. #16
    Hi,

    I just wonder that with my approach, why script registering is working but not for style registering. Can you answer my question?
  7. #17
    Well, it's just not supported.
Page 2 of 2 FirstFirst 12

Similar Threads

  1. [CLOSED] MVC - Direct Method
    By adelaney in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 19, 2012, 9:43 PM
  2. [CLOSED] Direct Method in UX
    By dev in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 30, 2012, 12:32 PM
  3. [CLOSED] RemoteSort method
    By gets_gui in forum 2.x Legacy Premium Help
    Replies: 19
    Last Post: Apr 20, 2012, 8:43 PM
  4. [CLOSED] Access with Direct Method
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 23, 2011, 4:45 PM
  5. Replies: 1
    Last Post: Jul 25, 2011, 9:59 AM

Tags for this Thread

Posting Permissions