找不到网页资源

发布于 2024-09-30 03:52:32 字数 935 浏览 1 评论 0原文

我在使用网络资源时遇到一些问题,不断收到错误消息:

网络资源 '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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文