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 7870219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:33:26+00:00 2026-06-03T01:33:26+00:00

I am setting a PATH for images in my web.config file. On each page,

  • 0

I am setting a PATH for images in my web.config file. On each page, I am setting a public property like:

    public string ImgPath
    {
        get { return Config.CDNImages; }
    }

Then in the design page I use

<img src='<%#ImgPath%>/products/<%#Eval("prodID")%>.jpg'/></a>

It works, but now I want to add this public property on the MasterPage so I can access ImgPath on every page.

I cant seem to get the <%#ImgPath%> to work when the property in on the MasterPage.
I have tried <%#Master.Page.ImgPath%> .. and many other variation, but I cant seem to get it to work.

How do I get the public property within a MasterPage on a design page using in-line request/binding?

  • 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-03T01:33:28+00:00Added an answer on June 3, 2026 at 1:33 am

    I don’t think this will work:

    <%#Master.Page.ImgPath%>
     or
    <%#Page.Master.ImgPath%>
    

    Because Page.Master returns a base class, not the specific class of your master page, which means the ImgPath property won’t be available without casting the Page.Master object. That would get very tedious to do every time.

    Instead of adding the property to your master page, have you considered doing something like this?

    public abstract class YourPage : Page
    {
        public string ImgPath
        {
            get { return Config.CDNImages; }
        }
    } 
    

    Now change your pages so they inherit from YourPage instead of Page, and you should have access to your method on every page.

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

Sidebar

Related Questions

I have xml like this: <configurationData> <path name='b'> <path name='a'> <setting name='s1'> ![CDATA[XXXX]] </setting>
I have a file that essentially a list of XPaths like so: /Options/File[1]/Settings[1]/Type[1] /Options/File[1]/Settings[1]/Path[1]
My Activity contains this code to get all images on the SD card: String[]
I've created a web page and it contains some settings value in Web.Config for
I'm having trouble setting the path to a DLL that is not in the
I have a problem with setting Browsing Path in Delphi 2009: When I install
I have scroll view with page controll i have images in scroll view i
I have a web application, where i am storing all the images in a
I have created Layer for each of my background images in the following order:
I am setting a custom file validator for a file input field in Symfony

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.