Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8516399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:25:00+00:00 2026-06-11T05:25:00+00:00

I asked a similar question before but the response was pretty weak, so not

  • 0

I asked a similar question before but the response was pretty weak, so not sure if I worded it correctly.

I currently have a custom server control on an asp.net page. However the control uses entirely embedded JavaScript and Image resources. My assembly has all of the web resources correctly set-up and I have been using the images etc as icons sucessfully.

However now, if possible I would like to use the embedded webresource images directly in the javascript file. I have tried the following with no luck so far:

document.getElementById('button').src = 'WebResource("NAMESPACE.FOLDER.IMAGE.png")';
document.getElementById('button').src = '<%WebResource("NAMESPACE.FOLDER.IMAGE.png")%>';

I am not sure what else to try as most of my googling seems to meet a dead end.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:25:02+00:00Added an answer on June 11, 2026 at 5:25 am

    I believe you are looking for the WebResourceAttribute.PerformSubstitution Property:

    WebResourceAttribute.PerformSubstitution on MSDN

    We use it in the AssemblyInfo.cs file in the project where embedded resources are defined:

    [assembly: System.Web.UI.WebResource(““, “text/css”, PerformSubstitution = true)]

    Edited:

    AssemblyInfo.cs

    [assembly: System.Web.UI.WebResource("Project.Content.Styles.css", "text/css", PerformSubstitution = true)]
    [assembly: System.Web.UI.WebResource("Project.Images.Sprite.png", "image/png")]
    

    Content/Styles.css (embedded resource)

    .icon {
        background-image: url(<%=WebResource("Project.Images.Sprite.png")%>);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have asked a similar question before, but didn't get very good results. I've
I asked a similar question before, but got no helpful response so I will
I have asked a similar question before here , but after much thought, and
I've asked a very similar question before, but this time is not about VB
Sorry I know similar question have been asked many times before but like most
I have asked a similar question before, but I didn't have a firm grasp
Another Newbie question in XSLT transformation. (I have asked similar question before, but in
This is a similar question to those that have been asked before, but still
OK, I asked a similar question before but was too confusing because of my
I asked a similar question before, but it was answered inadequately so I thought

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.