Error unrecognized tag prefix or device filter expedite

Sep 21, 2012 at 11:57 AM

Hi Chris,

Thanks for your reply on another thread.

There is another issue today when I am trying to fully configure Expedite using web controls.

I have added CompositeResourceHandler in handlers section of web.config file. Now when I try to add <xpedite:CompositeResourcePlaceholder runat="server" /> in the aspx page, Visual Studio 2010 is not recognizing it and giving me error 'unrecognized tag prefix or device filter 'xpedite'. Web.config is attached for your reference.

I have added reference to all dlls given in the xpedite package.

Any pointers what could be wrong?

Regards,

Amita

From: cbaxter [email removed]
Sent: Thursday, September 20, 2012 6:23 PM
To: Amita Bhakkad
Subject: Re: 500 Internal server error - Problem with the resource you are looking for... [xpedite:396189]

From: cbaxter

No worries, please let me know if you do run in to any other issues.

Chris

DISCLAIMER ========== This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

Sep 21, 2012 at 2:09 PM
Edited Sep 21, 2012 at 2:12 PM

Hi,

Based on the described error, it sounds like the Xpedite assembly has not been registered with the page correctly.

<%@ Register Assembly="Xpedite" Namespace="Xpedite.WebControls" TagPrefix="xpedite" %>

I recommend looking at the sample web application found in the source.

http://xpedite.codeplex.com/SourceControl/changeset/view/40de7f970c6c#SampleWebApplication%2fDefault.aspx

Best regards,

Chris

Sep 24, 2012 at 1:41 PM

Hi Chris,

Thanks for quick response. It worked fine after properly registering the control on the page.

Now I am facing 2 issue -

  1. Few images in CSS are not being loaded which are referred as ../images. Others which are referred directly are working correctly.
  2. It does not resolve server side variables in the tab. For example if my original tag is <link href='<%=PortalUtils.GetSkinUrl()%>' rel="stylesheet" type="text/css" /> then   PortalUtils.GetSkinUrl() does not get resolved when added to CompositeResourcePlaceholder. Is this supported?

Thanks,
Amita

Sep 24, 2012 at 5:51 PM

Hi Amita,

CSS url re-writing is currently not supported; I had planned on adding this feature in v2.0, but I have found myself using RequireJS and/or MVC4 bundling so it hasn't been high on my priority list.

As for the second point, the CompositeReourcePlaceholder goes in your page head, the actual resource definition would look something like:

<xpedite:CompositeResource runat="server" Type="Css" ReferenceName="bundle">
    <xpedite:Resource Url="PortalUtils.GetSkinUrl()" />
    ...
</xpedite:CompositeResource>

Exact syntax may not be 100%, but the CompositeResource defines the bundled package(s). Is that roughly how your definition looks? 

Chris

Sep 27, 2012 at 10:21 AM

Thanks Chris. Actually URL for this CompositeResource needs to be fetched dynamically by calling a function GetSkinUrl of PortalUtils.cs file.  Earlier I used to do it with <%= %> in link tag like this -  <link href='<%=PortalUtils.GetSkinUrl()%>' rel="stylesheet" type="text/css" />

When I set PortalUtils.GetSkinUrl() as a url in xpedite.cCompositeResource, it does not work and gives me cannot connect to remote server error.

<xpedite:CompositeResourcePlaceholder runat="server" />    
    
        <xpedite:CompositeResource ID="CompositeResource1" runat="server" Type="Css" ReferenceName="bundle" >
  <xpedite:Resource Url="~/Styles/Mediavalet/default/account.css" />
  <xpedite:Resource Url="~/Images/favico.ico" />
  <xpedite:Resource Url="~/Components/PortalUtils.GetSkinUrl()" />
</xpedite:CompositeResource>

Regarding CSS rewrite, can you give me some sample on how to use RequireJS and xpedite together?

Regards,
Amita

Sep 30, 2012 at 11:26 PM

Hi Amita,

To be honest, my memory of ASP.NET WebControl has faded to the background (only work with ASP.NET MVC4 now). That being said, your best course of action might be to inherit from Xpedite.WebControls.Resource to define custom behavior as required. Perhaps something like:

 

  public class SkinResource : Resource
  {
      public SkinResource()
      {
          Url = VirtualPathUtility.ToAbsolute("~/Components") + PortalUtils.GetSkinUrl();
      }
  }

 

You would then define the composite resource as follows:

<xpedite:CompositeResource ID="CompositeResource1" runat="server" Type="Css" ReferenceName="bundle" >
  <xpedite:Resource Url="~/Styles/Mediavalet/default/account.css" />
  <xpedite:Resource Url="~/Images/favico.ico" />
  <xpedite:SkinResource />
</xpedite:CompositeResource>

 


 

With regard to using Xpedite in conjunction with RequireJS, I would use only in the context of a partially Xpedited web-page (i.e., css/js compression and minification modules only); without the bundling support. If I wanted to bundle resources used by RequireJS, I would likely turn to http://requirejs.org/docs/optimization.html