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

  • Home
  • SEARCH
  • 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 3277784
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:24:28+00:00 2026-05-17T19:24:28+00:00

Hi new to spark so this should be simple. I’m converting an old webfoms

  • 0

Hi new to spark so this should be simple.

I’m converting an old webfoms page to mvc using spark.
I want to use the Base.Application to make up the src of a url

original markup

<img alt="" src="<%= Base.ApplicationPath %>images/screenshots/myImage.jpg" />

I’ve tried this in spark

<img alt= src=${  Base.ApplicationPath }+">images/screenshots/myImage.jpg" />

but no joy.

How do i do this in spark?

  • 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-05-17T19:24:29+00:00Added an answer on May 17, 2026 at 7:24 pm

    Not sure if you’re aware of this, but Spark has a DefaultResourcePathManager that will automatically locate the Site Root if you prefix the resource with a tilde, so this should work just fine, and looks neater.

    <img alt="" src="~/images/screenshots/myImage.jpg" />
    

    There’s an added bonus to using this technique as well….hold on to your shorts! Without changing your view, simply by making sure you use the tilde convention, you can dynamically redirect requests for your static resources to a content delivery network (CDN) or a completely different location – even an embedded resource inside a Spark Module .dll you compile for dll drop in deployment.

    For example, to hook it up to a CDN, all you’ll need to do is add the following kind of thing to your Spark Settings:

    <resources>
      <add match="/content/images" location="http://mycdn.com/youraccount/images"/>
      <add match="/content/css" location="http://mycdn.com/youraccount/css"/>
      <add match="/content/js" location="http://mycdn.com/youraccount/js"/>
    </resources>
    

    …and from then on those resources will be fetched from the new location instead. This is great for scenario testing locally, and the deploying to the cloud later.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

New to javascript/jquery and having a hard time with using this or $(this) to
I have this simple class: import spark.effects.GlowFilter; public class Letter extends Sprite { private
I just ran into trouble with the AreaDescriptionFilter of Spark using MVC 2 Beta.
Using ASP.NET MVC & Spark, I have a view that is listing a number
If you build a projection like this: t = Arel::Table.new(:projects) ps = t.project(t[:id].as(:snark)) How
new Date(05-MAY-09 03.55.50) is any thing wrong with this ? i am getting illegalArgumentException
what about this one: I want to format the currentTime displayed by a videoPlayer
In my controller I have this: ViewData[maskList] = new SelectList(equipmentRepository.GetMasks(), Id, DisplayName); and then
Is their a solution to generate an email template using an ASP.NET MVC View
I'm looking at the new version of ASP.NET MVC (see here for more details

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.