Combine two resource key for single label .Net

Viewed 3450

For making an existing site to multilingual, I follow globalization technique, I have created 3 resource files for different content like label & header text file, grid header text file etc... Now I have two keys in different resource files i.e Email and Message, at a third place I want to show both these keyword together i.e Email message. Do I need to create third key or I can concatenate already existing keys. Currently I am using below two codes

For showing directly on page:
HttpContext.GetGlobalResourceObject("ResourceLabelButton", "Email")

For showing as text of any control like Textbox, label:
Text ="<%$ Resources:ResourceContent, Email %>"

I can concatenate two resource string on .cs page but it will increase timeline, so please suggest so I can only change on .aspx pages.

Thanks in advance

5 Answers

Try with the below code

<asp:Label ID="lblNameAndNos" runat="server">
<%= ""+ Resources.Resources.Name + "/" + Resources.Resources.Nos %>  
</asp:Label>

Instead of using inside Text property use the above way

Related