[CLOSED] Generated Code (loading plugins)

  1. #1

    [CLOSED] Generated Code (loading plugins)

    I've been trying to understand some javascript that is generated from markup in order to recreate it myself:

    Ext.net.ResourceMgr.load([{
            url: "/ux/extensions/selectbox/selectbox-js/ext.axd?v=14483"
        },{
            mode: "css",
            url: "/ux/extensions/fileuploadfield/css/file-upload-css/ext.axd?v=14483"
        }]
    I don't understand what the 'v' parameter is doing? Is it loading a specific version of a file or something? The reason I'm trying to decipher it, is because I'm trying to load the Ext.ux.netbox.InputTextMask plugin via javascript, and so I'm trying to work out how other plugins are loaded. The view in question is completely dynamic and totally generated via javascript.

    I have the path: /ux/extensions/inputtextmask/inputtextmask.js that I got from the svn source.. I assume I should load it like:

    ux/extensions/inputtextmask/inputtextmask-js/ext.axd?v=?????

    .. but that doesnt seem to work, and I dont know what number to use anyways.

    Thanks.
    Last edited by Daniil; Mar 21, 2013 at 11:52 AM. Reason: [CLOSED]
  2. #2
    Hello!

    There is no different version of resource files. All resource files you can find in the following folder: "/Ext.NET Source/Ext.Net/Build/Ext.NET/". For instance, this file "/ux/extensions/selectbox/selectbox-js/ext.axd?v=14483" you can find there: "/Ext.NET Source/Ext.Net/Build/Ext.NET/ux/extensions/selectbox/selectbox.js"

    All details about how Ext.NET process resource requests you can find in Ext.NET/Core/ResourceHandler.cs
  3. #3
    Quote Originally Posted by Baidaly View Post
    Hello!

    There is no different version of resource files. All resource files you can find in the following folder: "/Ext.NET Source/Ext.Net/Build/Ext.NET/". For instance, this file "/ux/extensions/selectbox/selectbox-js/ext.axd?v=14483" you can find there: "/Ext.NET Source/Ext.Net/Build/Ext.NET/ux/extensions/selectbox/selectbox.js"

    All details about how Ext.NET process resource requests you can find in Ext.NET/Core/ResourceHandler.cs
    Many thinks, I'll investigate the source.
  4. #4
    Hello,

    Quote Originally Posted by peter.campbell View Post
    I don't understand what the 'v' parameter is doing? Is it loading a specific version of a file or something?
    It uses just as a cache buster. To ensure the new sources will be re-request If you update/change Ext.NET.

    Please note that our ResourceHandler (ext.axd) deals with the embedded resources from the Ext.Net.dll only. It can't work from embedded resources from other dlls.

    Quote Originally Posted by peter.campbell View Post
    The reason I'm trying to decipher it, is because I'm trying to load the Ext.ux.netbox.InputTextMask plugin via javascript, and so I'm trying to work out how other plugins are loaded.
    To load an InputTextMask's resources, you can use the RegisterControlResources.

    You can preload it during the Page_Load.
    protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                ResourceManager.RegisterControlResources<Ext.Net.UX.InputTextMask>();
            }
        }
    Well, it is possible to load it during DirectEvent.
    <ext:Button runat="server" Text="Load InputTextMask Resources" OnDirectClick="LoadInputTextMaskResources" />
    But there is no event to handle when the resources will be loaded. You can organize polling.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <%@ Register Assembly="Ext.Net.UX" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        [DirectMethod]
        public void LoadInputTextMaskResources()
        {
            ResourceManager.RegisterControlResources<Ext.Net.UX.InputTextMask>();
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    
        <script type="text/javascript">
            var loadInputTextMaskResources = function () {
                var task = {
                    run: function () {
                        if (Ext.ux.InputTextMask) {
                            alert("Ext.ux.InputTextMask is loaded");
                            Ext.TaskMgr.stop(task);
                        }
                    },
                    interval: 100
                }
    
                Ext.net.DirectMethods.LoadInputTextMaskResources({
                    success: function () {
                        Ext.TaskMgr.start(task);
                    }
                });
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Button 
                runat="server" 
                Text="Load InputTextMask Resources" 
                Handler="loadInputTextMaskResources" />
        </form>
    </body>
    </html>
  5. #5
    Quote Originally Posted by Daniil View Post
    Hello,



    It uses just as a cache buster. To ensure the new sources will be re-request If you update/change Ext.NET.

    Please note that our ResourceHandler (ext.axd) deals with the embedded resources from the Ext.Net.dll only. It can't work from embedded resources from other dlls.



    To load an InputTextMask's resources, you can use the RegisterControlResources.

    You can preload it during the Page_Load.
    protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                ResourceManager.RegisterControlResources<Ext.Net.UX.InputTextMask>();
            }
        }
    Well, it is possible to load it during DirectEvent.
    <ext:Button runat="server" Text="Load InputTextMask Resources" OnDirectClick="LoadInputTextMaskResources" />
    But there is no event to handle when the resources will be loaded. You can organize polling.

    Example
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <%@ Register Assembly="Ext.Net.UX" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        [DirectMethod]
        public void LoadInputTextMaskResources()
        {
            ResourceManager.RegisterControlResources<Ext.Net.UX.InputTextMask>();
        }
    </script>
    Thank you, I will just preload it in this case, I think.
  6. #6
    Well, If appropriate, it is much simpler.

Similar Threads

  1. [CLOSED] How to add a style to a code behind generated control
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Jun 12, 2012, 5:01 PM
  2. Remove gridfilters generated from code behind
    By mkshields9w57 in forum 1.x Help
    Replies: 1
    Last Post: Jun 04, 2012, 3:27 AM
  3. Replies: 2
    Last Post: Nov 15, 2011, 11:13 PM
  4. Semicolon is missing in generated code
    By hesspet in forum 1.x Help
    Replies: 10
    Last Post: Aug 16, 2011, 3:18 PM
  5. How to remove dynamically generated grid in code behind
    By mkshields9w57 in forum 1.x Help
    Replies: 0
    Last Post: Jul 07, 2011, 12:53 PM

Tags for this Thread

Posting Permissions