master page images not showing on child pages - asp.net

This is probably something really simple but I cant see what!
Any images I have in a masterpage aren't showing up in child pages,
all I get is the box with the red cross in it.
I don't think Ive done anything different from usual and it's not something that's
happened in other sites so im kinda scratchin my head with it.
Any ideas are appreciated!

Kevin's got the essence of the problem right - your URL in your master page is likely relative to the location of the master page, and when it's included in the child page, the relative reference isn't correct anymore. The simplest solution for this sort of thing is to have your master page URLs be relative to the site, not the page. In other words, if you've been doing
<img src="images/picture1.gif">
You need to replace that with
<img src="/images/picture1.gif">
or something similar.

in the master page you use the image src similar to the below line and this will work. this same problem solved usig this way.
src="<%= Page.ResolveUrl("~")%>Images/myimage.png"

Did you give the image runat="server" and use a root relative "~/" path to the file?

The URL to your image is incorrect.

Try using absolute paths to your images.
I've had this problem when using a master file with content pages in different subdirectories.
If you use relative paths to your images, thay should be relative to the content page, not the master.
Edit: This is true if you use the img tag to display your images. asp:Image behaves better =)

It definitely sounds like you have a pathing problem. View the source to your rendered page and take a look at where it's trying to load the image from, that should help you fix your path.

If you set the right path then also you are getting the same problem then you can try this will definitely solve your problem:
Use double dots(..) before the starting of url.

If Content pages are located inside subfolders this problem arises. When a content page is rendered the markup is generated afresh for the master page content as well, and the location of an image may render differently as it appears in the master page. The best way is to replace with asp:Image control instead of HTML image tag. Then define the absolute starting with:~/ to actual location of the image. This should solve the problem. Please remove the entire image tag before inserting asp:Image as attributes are different for both.
Good Luck !!.

If you use image<img> tag instead of this, please use "style="background-image: url('/Images/welc.jpg');"in any other tag. This looks like a silly.But it works for me. I was also getting this problem,after using this thereafter I got image at all my child pages.

Related

CSS - trying to apply background-image, using ~/ not working

I'm trying to apply a background-image to a header in a site.master file. If I use:
background-image:url('./themes/Modern/images/bg_full.png')
It works fine for all root level pages, but for any dynamic pages higher up directory structure it does not apply. So I changed it to:
background-image:url('~/themes/Modern/images/bg_full.png')
But when I do this the image does not show on any of the pages. Any help appreciated.
CSS is client based. Basically what your code does is creating a GET request like: http://domain.com/css/~/themes/Modern/images/bg_full.png
You probably want something like:
background-image:url('/themes/Modern/images/bg_full.png'); since this will result in a request like http://domain.com/themes/Modern/images/bg_full.png
background-image:url('http://your-domain-host.com/path_to_images/bg_full.png');
try it if not working then give me your page url i will give you exact code

FancyBox not working in asp.net

I have downloaded fancybox-1.3.4, I tried using it with one of my pages(which has a master page which has the same DOCTYPE as index.html of fancybox-1.3.4) I copy pasted the entire code(subtracting head, body etc) but it doesn't seem to work, however, if I copy paste the entire code(including doctypes etc. all) to a new Default.aspx without master page, it work perfectly.
please
Help me out here.
I agree with the other posters; it's hard to know without seeing the code. But master pages do change the client IDs on the page. If you're calling the fancy box by ID, you might want to try it with a css class.
i.e.
$(".fancy").fancybox();
...
click here
instead of:
$("#my_link").fancybox();
...
click here

Drupal: images don't show up inside the block (text only)

I've added the following code inside a Drupal block, to display an image.
<img alt="Fuzion logo" src="sites/all/themes/zen/zen/logo.png" />test<br />
I've tried several urls. For none of them I can see the image in my front-end website. The block only contains the text "test".
hostingpath/sites/all/themes/zen/zen/logo.png ---> I can see the logo in back-end (editing field, only with this)
sites/all/themes/zen/zen/logo.png
logo.png
thanks
Did you remember to use an appropriate filter that allows img tags?
Although your question was answered, I have found this also can happen when using the pathauto module with the path to your page set as a "subdirectory"; e.g. www.example.com/path/to/page.
As a result, the web server will look for your image at /path/to/page/sites/all/themes/zen/zen/logo.png because the URL is relative.
If this occurs, make sure to provide an absolute URL by including a forward slash at the beginning, i.e. /sites/all/themes/zen/zen/logo.png instead of sites/all/themes/zen/zen/logo.png.
Perhaps this answer will assist someone else with a similar problem.

Joomla css path

I'm having a problem whit this website i'm building - www.bodyheat.uk.com .
The first page (home) appears as i "wrote" in the css, but in the other ones the webpage it seems that the webpage cant call the css.
Anyone can help me on that?
TRICAT answered this
"You must have the base of your urls in the pages wrong because the css and js are using a relative url including the name of the page..
/joomla/index.php/templates/system/css/system.css
And obviously it should be:
/joomla/templates/system/css/system.css
The www.bodyheat.uk.com works because it doesn't have a page name behind the url."
But where I can change it? In what file? configuration? I saw what you said but dont know where to go to change it :(
THANKS ALL!!
You must have the base of your urls in the pages wrong because the css and js are using a relative url including the name of the page..
/joomla/index.php/templates/system/css/system.css
And obviously it should be:
/joomla/templates/system/css/system.css
The www.bodyheat.uk.com works because it doesn't have a page name behind the url.
I had this problem as well when I was creating a custom template. In the Global configurations, under SEO Settings, I turned OFF 'Search Engine Friendly URLs'. This fixed my problem.
Thanks!

Page title disappeared behind body

I created a new ASP.NET MVC application. The home page looks like this:
I tried to move the [ Log On ] link to the bottom of the page and got this:
What did I do wrong?
EDIT: [Here's][3] the CSS code, [here's][4] the original file, and [here's][5] the changed file.
(broken links to PasteBin removed)
Most likely, the CSS for your page has some preconceived notions of where and how big each will be, and you've confused it by moving them around.
In other words, the containing your main welcome block there does not use absolute positioning, but instead relies on a spacer (the login block) above it for correct spacing.

Resources