what's the difference between assigning text to a Label using meta:ResourceKey
and
Text="<%$ Resources:MyKey %>"
. i get the same results using both methods.
The first form is called an implicit resource expression, the second form is an explicit resource expression.
They may give the same result for a single property. However, the implicit meta:ResourceKey
has some advantages in that if there are several resourced property definitions in the local resource file, all of them will be applied with just that single declaration. The disadvantage is that it has to be from the "local" resource file, i.e. the resource file for that page.
If you use the explicit property assignment of Text="<%$ Resources:MyKey %>"
, you'll need to add that code for every property value you want to fetch from the resource file. However, the advantage is that you can specify a filename parameter and fetch the resource from a global resource file.
Here's a reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With