locked
HTML formatting in Resource files RRS feed

  • Question

  • User763094243 posted

    Hi all,
    I am working on a website in multiple languages and have been using resource files in App_GlobalResources to do this. I have modified the schema as follows to allow html in the values so I can add some formatting to the text -

    <xsd:complexType name="text"> 
    <xsd:complexContent mixed="true"> 
    <xsd:restriction base="xsd:anyType"> 
    <xsd:sequence>
     <xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/> 
    </xsd:sequence>
     <xsd:attribute ref="xml:lang"/>
     </xsd:restriction>
     </xsd:complexContent> 
    </xsd:complexType>

    and

    <xsd:element name="data"> 
    <xsd:complexType> 
    <xsd:sequence> 
    <xsd:element name="value" type="text" /> 
    <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> 
    </xsd:sequence>
     <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> 
    <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
     <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
     <xsd:attribute ref="xml:space" /> 
    </xsd:complexType> 
    </xsd:element>
    Unfortunately as soon as I add any html to the text in the resource file, I can no longer read it, either as an object or string - 
    String text = Global.SiteResourceManager.GetString(textName, culture);
    Anyone know how to do this if it is possible?
     
    Best wishes,
    Robert


    Wednesday, November 16, 2011 11:59 AM

All replies

  • User1519636740 posted

    see 

    http://msdn.microsoft.com/en-us/library/ekyft91f(v=VS.90).aspx

    Friday, November 18, 2011 2:45 AM