[CLOSED] MVC - Register an Icon

  1. #1

    [CLOSED] MVC - Register an Icon

    Hi there,

    I need to register an icon. Could you please tell me how to do that? I've tried as so
    X.ResourceManager.RegisterIcon(Icon.LockOpen)
    but not working.

    Thanks in advance.
    Last edited by Daniil; Sep 12, 2014 at 6:57 AM. Reason: [CLOSED]
  2. #2
    Hi @thchuong,

    Please clarify where exactly do you call this code?
  3. #3
    hi Daniil,

    I called it in Razor
  4. #4
    It appears to be working with the test case below.

    Example #1
    <!DOCTYPE html>
    <html>
    <head>
        <title>Ext.Net.MVC v2 Example</title>  
    </head>
    <body>
        @Html.X().ResourceManager()
    
        @{
            X.ResourceManager.RegisterIcon(Icon.LockOpen);
        }  
    
        @Html.X().Button().Text("LockOpen").IconCls("icon-lockopen")
    </body>
    </html>
    Though, it might be better to use
    Ext.Net.MVC.MvcResourceManager.RegisterGlobalIcon(Icon.LockOpen);
    Example #2
    @{
         Ext.Net.MVC.MvcResourceManager.RegisterGlobalIcon(Icon.LockOpen);
    }
    
    <!DOCTYPE html>
    <html>
    <head>
        <title>Ext.Net.MVC v2 Example</title>  
    </head>
    <body>
        @Html.X().ResourceManager()
    
        @Html.X().Button().Text("LockOpen").IconCls("icon-lockopen")
    </body>
    </html>
    There are some client side approaches as well:
    http://forums.ext.net/showthread.php...ll=1#post94316
  5. #5
    Thank you Daniil. It's now working. You can close the topic.

Similar Threads

  1. DirectMethod cant Register my Array
    By kmlplt in forum 1.x Help
    Replies: 7
    Last Post: Nov 12, 2012, 8:55 PM
  2. [CLOSED] How to register Trigger Icons?
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 05, 2012, 12:43 PM
  3. [CLOSED] Namespace Does not register
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 22
    Last Post: Nov 07, 2011, 10:10 AM
  4. [CLOSED] register xtype
    By RomualdAwessou in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Nov 03, 2010, 6:49 PM
  5. combobox not show the first register of Store
    By DarkDucke in forum 1.x Help
    Replies: 0
    Last Post: Mar 04, 2009, 2:23 PM

Posting Permissions