views:

319

answers:

1

I want to use two meta:resourcekey in single control is it possible?

for example "< asp:LinkButton meta:resourcekey="ImageUrlKey1" meta:resourcekey="ToolTipKey1" >"

Thanks, Piyush

+1  A: 

I guess you have two possibilities:


When using implicit localization you define several key/value pairs for the localized properties of the LinkButton1 in your resource file, e.g. for:

LinkButton1.ImageUrl
LinkButton1.ToolTip

and then use only one meta:resourcekey attribute:

<asp:LinkButton meta:resourcekey="LinkButton1" ... />

Or you use explicit localization instead, i.e. which uses a different syntax instead of meta:resourcekey:

<asp:LinkButton
  ImageUrl="<%$ Resources:WebResources, Button1ImageUrl %>"
  ToolTip="<%$ Resources:WebResources, Button1ToolTip %>" />

In any case, have a look at this article, which explains it in detail.

M4N
Using Resources:WebResources isn't really a change of syntax though is it. Although I agree that going down the global resource file route is an alternative.
Joe R
@Joe R: yes, it's probably not correctly worded. But I guess the difference is clear from the examples: with the first approach you specify just one resource key, while with the second approach you have to specify the resource key for each localized property.
M4N
Fair enough. At least you've highlighted an alternative.
Joe R
Both the methods are useful for me, the first one is for using Local resource file where my the values are related to page. Some of the part I want to use from Global in which case the second method will be useful.. Thanks Martin!!
A Bright Worker