[CLOSED] [1.0] MVC PartialViews and Icons

  1. #1

    [CLOSED] [1.0] MVC PartialViews and Icons

    Hello vladimir,

    Just wanted to let you know that registering icon resources do not work in partial ext views.


    Cheers,
    Timothy
  2. #2

    RE: [CLOSED] [1.0] MVC PartialViews and Icons

    You'll have to do that in your master page or base page.

    Cheers,

    Sandor Drieƫnhuizen
    Subspace
  3. #3

    RE: [CLOSED] [1.0] MVC PartialViews and Icons

    Hello SandorD,

    I'm going to have to disagree, if you check the following example you will note that the icon is registered in a <style> tag and theoretically should be handled like all the previous style hacks we performed. I think the problem now is that the PartialExtRenderer is trying to place it in the head of the page which obviously doesn't exist due to the separation from MVC.

    Example.aspx:

    <%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
    <!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 id="Head1" runat="server">
        <title>Example</title>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Label ID="Label1" runat="server" Icon="Accept" Text="Accept" />
    </body>
    </html>
    Generates the following:

    <style type="text/css">
      .icon-accept{background-image:url(/icons/accept-png/ext.axd) !important;}
    </style>
    Vladsch, I would think that since we have hijacked the life cycle of controls and how they render for MVC having a clause for the icons to not be rendered in the head of the site but rather the same method as all <style> tags in a partial would be the best solution. Your thoughts?

    I'm hoping I don't have to register icons in the master or parent page ... if so fml.

    Cheers,
    Timothy
  4. #4

    RE: [CLOSED] [1.0] MVC PartialViews and Icons

    Hi,

    What if you register icon inside partial view like in the following view (just it is hard to register icons under MVC inside partial view)?

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <style type="text/css">
            .icon-bomb{background-image:url(/icons/bomb-png/ext.axd) !important;}
    </style>
    
    <ext:Window ID="Window1" runat="server" Width="500" Height="500" Modal="true">
        <Content>
            <ext:Panel runat="server">
                <Content>
                    <ext:Button runat="server" Icon="Bomb" />                
                </Content>
            </ext:Panel>
        </Content>
    </ext:Window>
  5. #5

    RE: [CLOSED] [1.0] MVC PartialViews and Icons

    I wouldn't say it's the most ideal solution, I'm guessing you're having troubles with it on the output from the toolkit huh?

    Works for me, but I think it's going to open a lot of questions in the future :)


    Cheers,
    Timothy

  6. #6

    RE: [CLOSED] [1.0] MVC PartialViews and Icons

    Hi,

    I'll investigate this problem. I am guess that I will be able to add automatic icon registering. Give me some days. Please use previous solution until notification from me
  7. #7

    RE: [CLOSED] [1.0] MVC PartialViews and Icons

    Thanks vladimir, no rush. I'm using your other method until you want me to check and test.

    Cheers,
    Timothy
  8. #8

    RE: [CLOSED] [1.0] MVC PartialViews and Icons

    Hi Timothy,

    Now icons are registered automatically. Please update extnet-mvc

Similar Threads

  1. [CLOSED] icons
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 16, 2012, 6:46 PM
  2. Load PartialViews on Panel
    By Dominik in forum 1.x Help
    Replies: 5
    Last Post: Feb 25, 2011, 9:19 AM
  3. [CLOSED] [1.0] MVC PartialViews and styles?
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 14
    Last Post: Feb 14, 2010, 4:12 PM
  4. [CLOSED] Custom icons
    By danielg in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 03, 2009, 7:10 AM
  5. Replies: 0
    Last Post: Apr 03, 2009, 5:47 AM

Posting Permissions