[CLOSED] Icons don't show [Razor]

  1. #1

    [CLOSED] Icons don't show [Razor]

    In my projet icons don't show in Razor code.

    For example:

    ...
    .Buttons(buttons =>
                {
                    buttons.Add(Html.X().Button().ID("ButtonSave").Text(Resources.R.Sacuvaj).Icon(Icon.DatabaseSave));
                })
    This is for all icons except when use javascript code where icons showing:

    Ext.MessageBox.show({ title: '@Resources.R.UN', msg: '@Resources.R.UNO', buttons: Ext.Msg.OK, icon: Ext.MessageBox.WARNING, width: 250 });
    In project solutinon I added Ext.Net (source project) as separate project. I don't use only dll-s.

    Do I need any reference to icons?
    Last edited by Daniil; Apr 25, 2012 at 2:37 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I was unable to reproduce the problem using the example below.

    Example
    @{ Layout = ""; }
     
    <!DOCTYPE html>
    
    <html>
    <head>
        <title>Ext.NET v2 Example</title>
    </head>
    <body>    
        @Html.X().ResourceManager()
        @Html.X().Button().Icon(Icon.DatabaseSave)
    </body>
    </html>
    Please provide a full example. I will check it's reproducible with the latest sources or not.

    Or update from SVN and re-test. If the issue persists, please provide a sample.
  3. #3
    Update from svn not helps.

    Here is full test example:

    View:

    @{
        Layout = "";
        ViewBag.Title = "Index";
    }
    
    <h2>Index</h2>
    
    @Html.X().ResourceManager()
    
    @(Html.X().Button().Text("tekst").Icon(Icon.Accept))
    Controller:

    public class TestController : System.Web.Mvc.Controller
        {
            //
            // GET: /Test/
    
            public ActionResult Index()
            {
                return View();
            }
    
        }

    Web.config in Views folder:

    <?xml version="1.0"?>
    
    <configuration>
      <configSections>
        <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
          <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
        </sectionGroup>
      </configSections>
    
      <system.web.webPages.razor>
        <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <pages pageBaseType="System.Web.Mvc.WebViewPage">
          <namespaces>
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Routing" />
              <add namespace="Ext.Net" />
              <add namespace="Ext.Net.MVC" />
          </namespaces>
        </pages>
      </system.web.webPages.razor>
    
      <appSettings>
        <add key="webpages:Enabled" value="false" />
      </appSettings>
    
      <system.web>
        <httpHandlers>
          <add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false"/>
          <add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
        </httpHandlers>
    
    
    
        <!--
            Enabling request validation in view pages would cause validation to occur
            after the input has already been processed by the controller. By default
            MVC performs request validation before a controller processes the input.
            To change this behavior apply the ValidateInputAttribute to a
            controller or action.
        -->
        <pages
            validateRequest="false"
            pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
            pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
            userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <controls>
            <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
          </controls>
        </pages>
      </system.web>
    
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
    
        <handlers>
          <remove name="BlockViewHandler"/>
          <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
        </handlers>
      </system.webServer>
    </configuration>

    Web.config in web project:

    <?xml version="1.0"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=152368
      -->
    
    <configuration>
      <appSettings>
        <add key="webpages:Version" value="1.0.0.0"/>
        <add key="ClientValidationEnabled" value="true"/>
        <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
      </appSettings>
        
      <system.web>
        <compilation debug="true" targetFramework="4.0">
          <assemblies>
            <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          </assemblies>
            
            
        </compilation>
          
          <httpModules>
              <add name="DirectRequestModule" type="Ext.Net.DirectRequestModule, Ext.Net"/>
          </httpModules>
          
        <authentication mode="Forms">
          <forms loginUrl="~/Account/LogOn" timeout="2880" />
        </authentication>
    
        <pages>
          <namespaces>
            <add namespace="System.Web.Helpers" />
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Routing" />
            <add namespace="System.Web.WebPages"/>
          </namespaces>
        </pages>
      </system.web>
    
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>
    
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>
    Global.asax:

    namespace TestIcons
    {
        // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
        // visit http://go.microsoft.com/?LinkId=9394801
    
        public class MvcApplication : System.Web.HttpApplication
        {
            public static void RegisterGlobalFilters(GlobalFilterCollection filters)
            {
                filters.Add(new HandleErrorAttribute());
            }
    
            protected void Application_AuthenticateRequest(object sender, System.EventArgs e)
            {
                string url = HttpContext.Current.Request.FilePath;
    
                if (url.EndsWith("ext.axd"))
                {
                    HttpContext.Current.SkipAuthorization = true;
                }
            }
    
            public static void RegisterRoutes(RouteCollection routes)
            {
                routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
                routes.IgnoreRoute("{exclude}/{extnet}/ext.axd");
    
                routes.MapRoute(
                    "Default", // Route name
                    "{controller}/{action}/{id}", // URL with parameters
                    new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
                );
    
            }
    
            protected void Application_Start()
            {
                AreaRegistration.RegisterAllAreas();
    
                RegisterGlobalFilters(GlobalFilters.Filters);
                RegisterRoutes(RouteTable.Routes);
            }
        }
    }
  4. #4
    Also I try in test example to use onlly dll references to Ext.Net, Transformer.NET, Newtonsoft.Json. Result is the same: no icons.
  5. #5
    What link did you update Ext.NET?

    It should be:
    http://svn.ext.net/premium/branches/2.0

    Also, I think, you should add
    <httpHandlers>
      <add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false"/>
    </httpHandlers>
    for the Web.config of the project.
  6. #6
    Yes, that tag must be in project web.config. Thanks!

    I use http://svn.ext.net/premium for download but when download I get project from folder branches/2.0/Ext.Net. I think that is the same as yours address. Is it?
  7. #7
    Quote Originally Posted by boris View Post
    I use http://svn.ext.net/premium for download but when download I get project from folder branches/2.0/Ext.Net. I think that is the same as yours address. Is it?
    Well, the the "branches/2.0" folder is the sub-folder of the "svn.ext.net/premium" one.

    Generally, if you are getting the sources from the "branches/2.0", it's correct.
  8. #8
    Yes, I am getting source from that branches/2.0 folder.
    Thanks.

Similar Threads

  1. [CLOSED] Grid row - visible show icons
    By MTSI in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Sep 28, 2012, 2:45 PM
  2. [CLOSED] [Razor] Summary column don't show sum
    By boris in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 10, 2012, 2:51 PM
  3. Replies: 5
    Last Post: Jul 22, 2011, 7:41 AM
  4. [CLOSED] Triggerfield icons don't show
    By SFritsche in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 02, 2010, 3:55 PM
  5. icons dont show
    By tonymayoral in forum 1.x Help
    Replies: 3
    Last Post: May 23, 2009, 9:59 PM

Tags for this Thread

Posting Permissions