November Happy Hour will be moved to Thursday December 5th.

Translate a literal

Vote:
 

Works just great on my colleuges computer but not on mine, I must have missed something but I can't figure out what.

 <asp:Literal ID="test" runat="server" Translate="/bla/bla/bla" />

VS2008 and when I surf to the page both say "Type 'System.Web.UI.WebControls.Literal' does not have a public property named 'Translate'."

I run CMS5 SP1 and VS2008 on Vista, SDK is NOT installed. 

Hilfe!
/Fredrik, Internetfabriken

#20130
May 21, 2008 15:27
Vote:
 

Hmm, this is odd...

I've looked in the code that handles the translation and there seems to be a miss in the handling of literal controls, i.e. we don't. I think this was overlooked because the literal control lies within the WebControls namespace. A label control worked fine for me, but one of the differences between them is that the label control inherits from WebControl.

Are you sure you where using a literal control on your collegues computer as well? I'm asking because I do not see any way aliteral control should work :/.

What you could do is to use something like:
<asp:Literal ID="lit" runat="Server" text="<%$ Resources: EPiServer, button.search %>"/>

which would have been the same as:

<aspLiteral id="lit" runat="Server" translate="/button/search"/>

... had it worked.

 

#20134
May 21, 2008 17:26
Vote:
 

Well, you are correct. I looked at his code and it was labels not literals. Thanks for the $Resources-tip, i'll try that instead. 

#20135
May 21, 2008 18:32
Vote:
 

The $Resources-tip is how you should implement translate. It is how you use $Resources when i normally work with asp.net and languange in an xml-file.

Not sure if you can use that on an <episerver:property...> but for all aps.net-controls likte literal and label etc. 

 

Best Regards

/Eric 

#20136
May 21, 2008 23:04
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.