Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I asked a question maybe yesterday or two days ago tops about using ScriptResx.ashx with custom resource files. I noticed that at first my custom file wasn't being rendered through the handler because it was missing a chunk of code that the handler requires:

<!-- 
    Whether this .resx could be read by scriptResx.ashx handler. Only a file
    marked with scriptResx:true could be returned to client.
 -->
 <resheader name="scriptResx">
    <value>true</value>
 </resheader>
 <!-- the full name of the JavaScript class.  -->
 <resheader name="classFullName">
   <value>Custom.Resources.Global</value>
 </resheader>

Once I figured that out, I got my .resx file working -- until I added another property. Once you add a property via the Visual Studio Designer it re-writes the entire file, removing that needed code.

Does anyone have any tricks, tips or Visual Studio templates that will allow me to preserve that block of code while still allowing me to add resources via the Design view?

share|improve this question
    
Stupid problem. I don't know of any way to fix this... –  Dennis G Apr 8 at 16:56
2  
@DennisG I don't know if you still need this, but if you do - check the tool I have linked in my answer below. –  SPArchaeologist Jun 12 at 14:07

1 Answer 1

up vote 2 down vote accepted

Don't know if the OP still need this, but I hope it may be usefull to anyone experiencing the same issue.

Turn out that Wictor Wilén has built a visual studio extension that manages the aforementioned setting automatically. You can find it on the Visual Studio Gallery under the name "SPResX Visual Studio 2012 Extension". It also offer the ability to customize the "namespace" of the generated javascript class.

Link to the original blog post

share|improve this answer
    
Awesome! Good thing I favorited this question. –  Dennis G Jun 13 at 5:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.