Main question:
Why use custom localization helpers if there is something built-in doing the same already?
Long story
Currently I have been reading many options to localize your asp.net mvc website. Most of the posts are old, from oktober 22 2008 for instance.
I think one of the most linked option is the following: Matt Hawley on eWorld. This option creates an Html helper which can be used with
Html.Resource("ResourceName")
Html.Resource("GlobalResourceFileNameWithoutExtension, ResourceName")
for local and global resources. Other use the
<asp:label meta:resourcekey="lblNameResource1" runat="server"/>
instead of
<label></label>
Some problems I had while trying the methods I found were when using <.asp:labels> my partial pages recieve some pretty errors like on my partial page rendering:
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or
cluster, ensure that <machineKey> configuration specifies the same validationKey and
validation algorithm. AutoGenerate cannot be used in a cluster.
In the end, I am wondering, why all this trouble if there are standard methods like:
<%= GetLocalResourceObject("lblNameResourceKey") %>
What are the downsides of using the built in functions? Of course I am not happy with having to use string keys but all methods use them so I think that is inevitable in the end. The only downside I can think of is that every string needs its key, while using asp:labels have some autofunctions builtin (like lblName.Text / lblName.ToolTip etc). But than why is this Matt Hawley so rumored? He uses the exact same approach as the built-in GetLocalResourceObject, only naming it differently with his own helper methods?
Or Am I missing something?