locked
Adding checkmarks in HTML description via resource files RRS feed

  • Question

  • User-1246604461 posted

    When I check the the source of this page: view-source:http://www.zalando.nl/ I see this:

    <meta name="description" content="Schoenen, fashion, lifestyle &amp; sportartikelen online shop ► Geen verzend- en retourkosten ✔ Snelle levering ✔ Veilig betalen ✔ Meer dan 1500 merken!" />

    As you can see I see checkmarks in the source of the page in the metadescription.

    I'm trying to do the same: 

    default.aspx

    <%@ Page MetaDescription="<%$Resources:metadescription%>" Language="VB" MasterPageFile="~/main.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

    default.aspx.resx
    metadescription &#10004; Venues, &#10003; Events, &#x2713; Parties and Tickets

    but with me it shows the html codes (&#10004; Venues, &#10003; Events, &#x2713; Parties and Tickets) and NOT the checkmarks...I tried adding 3 different HTML codes as you can see below, to see which one is working, but nothing works.

    I also tried to non auto encode the HTML by replacing <% with <%=, like so:

    MetaDescription="<%=$Resources:metadescription%>"

    But that just renders:
    <meta name="description" content="&lt;%=$Resources:metadescription%>" />

    My environment:
    Visual Studio 2012
    Chrome browser


     

    Monday, August 5, 2013 12:06 PM

Answers

  • User-742633084 posted

    Hi Peter,

    I think the behavior might also be related to how the meta content string is assigned to the <meta> tag. I've tried setting the meta tag content through 3 means:

    • directly set in html markup statically
    • use code behind to assign the tag
    • use inline expression to set the tag content in html markup

    and all of them output the correct check mark character in the response HTML content (via ViewSource or browser developer toolbar). Here is the test page for your information:

     ASPX MARKUP:

    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        
        <title></title>
         <meta name="author" content="Schoenen, fashion, lifestyle &amp; sportartikelen online shop ► Geen verzend- en retourkosten ✔ Snelle levering ✔ Veilig betalen ✔ Meer dan 1500 merken!" />
    
         <meta name="description" runat="server" id="metaName" />
    
         <meta name="keywords" content="<%= MetaContent %>"
    </head>
    <body>
    

    CODE-BEHIND:

    public partial class LocalizationPage : System.Web.UI.Page
    {
        protected string MetaContent = "Schoenen, fashion, lifestyle &amp; sportartikelen online shop ► Geen verzend- en retourkosten ✔ Snelle levering ✔ Veilig betalen ✔ Meer dan 1500 merken!";
    
        protected void Page_Load(object sender, EventArgs e)
        {
            this.metaName.Content = "Schoenen, fashion, lifestyle &amp; sportartikelen online shop ► Geen verzend- en retourkosten ✔ Snelle levering ✔ Veilig betalen ✔ Meer dan 1500 merken!";
    
        }
    }


     

     

     

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 13, 2013 6:07 AM