Hi Chuck,
I'm not sure, would you please check if the build action of the .js file is
also set to "Embedded resource" as the .gif file? Please note, the naming
of the webresource should be composed of three parts: default namespace +
subdirectory path + file name.
For example, if your assembly has default namespace "ClassLibrary1", and
the GridViewCheckBox.js is located at a subdirectory "test", the web
resource name should be "ClassLibrary1.test.GridViewCheckBox.js".
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Chuck P - 10 Jul 2007 22:54 GMT
Walter,
I did mess up and forgot to put the js file as an embedded resource.
However,
If I have the file in project directory at:
Util\Ctrl\GridView\GridViewCheckBox.js
and the assembly as
[assembly: WebResource("Util.Ctrl.GridView.GridViewCheckBox.js",
"application/x-javascript")]
everything works fine.
However if I move the file to:
Util\Ctrl\GridView\checkBox\GridViewCheckBox.js
and the assembly as:
[assembly: WebResource("Util.Ctrl.GridView.checkBox.GridViewCheckBox.js",
"application/x-javascript")]
it doesn't find it.
The project namespace is Util
The control which loads the embedded resource is in namespace
Util.Ctrl
Walter Wang [MSFT] - 11 Jul 2007 03:06 GMT
Hi Chuck,
Is the root/default namespace "Util.Ctrl"? and the directory in the project
starts with "GridView\checkbox\GridViewCheckBox.js"?
It's strange that it cannot find the resource. Can you send me a
reproducible project for further troubleshooting? Thanks.
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Walter Wang [MSFT] - 12 Jul 2007 06:54 GMT
Hi Chuck,
Thanks for the code.
I've done some test using your code:
1) Move GridViewCheckBox.js into its subfolder checkBox
2) Modify AssemblyInfo.cs to use:
[assembly: WebResource("Util.Ctrl.GridView.checkBox.GridViewCheckBox.js",
"application/x-javascript")]
3) Modify GridView_Ex.CheckBox.js:
private const string CheckBoxJsResourceLocation =
"Util.Ctrl.GridView.checkBox.GridViewCheckBox.js";
4) After I rebuilding the Ctrl.dll, I used a console program to test it and
it works correctly.
I suggest you rebuilding your project, of even re-add the reference if
necessary.
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Chuck P - 12 Jul 2007 15:40 GMT
thanks,
I had to go into the test project, remove the reference to the util class
and then add it back before it would work. Just deleting the dll didnt work.