In my latest project, I created a Custom Control DLL that extends existing Telerik and ASP controls. As part of this process, I also introduced new CSS classes that utilize images. However, I encountered an issue where these images were not being loaded in the main project.
Project Information:
Microsoft .NET Framework Version: 4.0.30319
ASP.NET Version: 4.8.4001.0
Telerik UI for Ajax 2014Q1
ASP Webforms
Steps Taken:
1. Included the necessary files (css and images) in the AssemblyInfo
2. Set PerformSubstitution = true
for the css file
3. Set the Build Action
for the images and the css file to Embedded Resource
4. Replaced the image paths in the css file with WebResource paths
5. Compiled the Library and placed it into my library directory within the main project
6. Added the controls in the web.config
Snippet from AssemblyInfo.cs
//Css
[assembly: WebResource("css.myCss.css", "text/css", PerformSubstitution = true)]
//Css related pictures
[assembly: WebResource("css.images.myImage.png", "image/png")]
Content of myCss.css
.myCssClass{
background-image: url('<%=WebResource("myProject.css.images.myImage.png")%>');
}
Content of web.config
<configuration>
<system.web>
<pages>
<controls>
<add tagPrefix="myControls" assembly="myProject" namespace="myProject" />
...
</controls>
</pages>
</system.web>
</configuration>
I am experiencing issues with the WebResource.axd
http requests for my control returning a 404
error. The telerik requests are functioning normally. Can anyone advise on how to resolve this issue and make those images work properly?
Thank you in advance, Lifree