Setting properties in resource file

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

Last updated:11/20/2014 6:07:33 AM

1 Answers

Takeshi Okada
Takeshi Okada

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