A simple question. I have a site with localization (with .resx files) and when i need to insert localized text i use a code like this:
<asp:Localize Text="<%$ Resources: MyResource, Default_BannerHomeTitle %>" runat="server">SOME_TEXT_HERE_OR_NOT?</asp:Localize>
The question is if anyone knows what’s the utility of the text between the asp:Localize tag -> “SOME_TEXT_HERE_OR_NOT?”
The real value come from the .resx file and the text “SOME_TEXT_HERE_OR_NOT?” is obviusly deleted when the page is rendered.
Is this text used in some situation? or is never used?
thanks in advance!
The
Textproperty you are setting inline and the text you type between the tags is effectively the same thing. You should be using one or the other, there’s no point in setting both.The
Localizecontrol is just a subclass of theLiteralcontrol. Technically, the text you type between the tags is interpreted as its own separateLiteralcontrol, a “parsed sub-object”. When theLocalizecontrol is created, itsTextproperty is set to the value of the sub-object’sTextproperty. However, setting theTextproperty explicitly on theLocalizecontrol will take precedence over anything typed between the tags.