You can use GetGlobalResourceObject , which does the same thing, but returns null, and does not throw an exception if the key does not exist.
<div><%= GetGlobalResourceObject("TranslationResource", "AppTitle") %></div>
You can easily add a fallback value using the zero-coalescing operator:
<div><%= GetGlobalResourceObject("TranslationResource", "AppTitle") ?? "No translation resource" %></div>
If you need to modify the behavior of the localization provider in a centralized way (without changing the syntax used on the pages), you can override resourceProviderFactoryType . Add this type to the globalization section of web.config ...
<globalization resourceProviderFactoryType="MyLocalizationProvider"/>
And create MyLocalizationProvider by subclassing ResourceProviderFactory .
source share