SETTING PROPERTIES IN RESOURCE FILE

marcel ethan

Total Post:105

Points:735
Posted by  marcel ethan
C#  Telerik 
 873  View(s)
Ratings:
Rate this:

My site needs to be french and english and I am using resource files to accomplish this. My boss now wants to see sample text inside the text boxes. We are using telerik controls to do this and I am trying to set the sample text to either english or french.

I may have to make a custom control for this so I can have an extra label that is the sample text.

My question is: Can you set other properties besides the text property in the resource files.

ie: Label1Resource.EmptyMessage.Text

with resource set to: Empty message

  1. Takeshi Okada

    Post:89

    Points:629
    Re: Setting properties in resource file

    For local resources ASP.NET matches the attributes in the element:

    <asp:Label ID="lblErrorMsg" runat="server" meta:resourcekey="lblErrorMsg" Text="Label"> 

    </asp:Label>

    So in the resource file you would define the localized text for "Text" as:

    name: lblErrorMsg.Text and value: Label

    If you have an attribute on the telrik control named EmptyText you would address that property in the resource file as such:

    name: lblErrorMsg.EmptyText value: Your text

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!