<ul>
<li><% Html.ActionLink(StringHelper.TryGetLocalString("Something"),
"Blah", "Blah"); %></li>
</ul>
I had to make the StringHelper class above public before I could see it from within my partial view.
Why??
(side note: resolving to local string will be done in my controller not in the view (layout) but its a good quick example).
Thanks for you help, Luke
Since the StringHelper is most likely not compiled into the same DLL as the rest of the code for the MVC site, it doesn't have access to internal things.
This will be the case when you have controllers, views, etc, as the default MVC website setup (and how it works when debugging) is to compile the regular code down to a DLL, then compile the pages/views separately. This also happens when you have "Updatability" setup when you publish the website.
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