找不到网页资源
我在使用网络资源时遇到一些问题,不断收到错误消息:
网络资源 'EMP.WebHelpers.Scripts.CostSearchControl.ascx.js' 未找到。未找到。
我的设置如下:
程序集名称:EMP.WebHelpers.dll
AssemblyInfo.cs:
[assembly: WebResource("EMP.WebHelpers.Scripts.SupplierAtoZControl.ascx.js", "application/x-javascript")]
[assembly: WebResource("EMP.WebHelpers.Scripts.CostSearchControl.ascx.js", "application/x-javascript")]
脚本保存在文件夹 <> 中。 projectroot >\Scripts\ 并且该文件夹中的两个脚本都设置为具有嵌入资源的构建操作。
当我将反射器指向程序集时,它找到两个资源,称为:
EMP.WebHelpers.Scripts.CostSearchControl.ascx.js
和
EMP.WebHelpers.Scripts.SupplierAtoZControl.ascx.js
最后将脚本添加到我的控件中,我调用
ScriptManager.RegisterClientScriptResource(Page, GetType(), "EMP.WebHelpers.Scripts.CostSearchControl.ascx.js");
所以在我看来,它看起来应该可以工作,但事实并非如此,我错过了什么?
I'm having some trouble with web resources, I keep getting the error:
Web resource
'EMP.WebHelpers.Scripts.CostSearchControl.ascx.js'
was not found.was not found.
My settings are as follows:
Assembly name: EMP.WebHelpers.dll
AssemblyInfo.cs:
[assembly: WebResource("EMP.WebHelpers.Scripts.SupplierAtoZControl.ascx.js", "application/x-javascript")]
[assembly: WebResource("EMP.WebHelpers.Scripts.CostSearchControl.ascx.js", "application/x-javascript")]
The scripts are held in a folder < projectroot >\Scripts\ and both scripts in this folder are set to have the build action of embedded resource.
And when I point reflector at the assembly It finds two resources, called:
EMP.WebHelpers.Scripts.CostSearchControl.ascx.js
and
EMP.WebHelpers.Scripts.SupplierAtoZControl.ascx.js
Finally to add the script to my control I call
ScriptManager.RegisterClientScriptResource(Page, GetType(), "EMP.WebHelpers.Scripts.CostSearchControl.ascx.js");
So to my eyes it all looks like it should work, but it doesn't, what am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论