MVC3 how do you specify a path to image - asp.net-mvc-3

the image is located under: /Content/panoramic/panoramas/UCCParc.tif
I access the image like:
<img src="#Url.Content("~/Content/panoramic/panoramas/" + #imgName + "")"/>
But when I try to load the page localhost/pano, where pano is a controller, the images are not found. Is this the correct way of acessing the file in MVC3? Is it correct to specify the folder hierarchi as the path to the image or should I somehow wrap a controller around the path?

It seems that your code is fine but the best way to find the problem is using "Inspect Element" or other tools (Bugs in Firefox) to find out the correct URL that generated by your code. (Right-Click on images space and select 'Inspect Element' and see if the path to image is correct or not).

Related

Kendo images don't display on PDF?

I am using Kendo UI editor and my image html is look like:
img alt="" src="http://mywebsite.com//ImageBrowser/Image?path=lion.png"
When I open this on browser it displays the image, but when I try to convert it to PDF, It doesn't display the image. Image src = actually is MVC controller/action. Is this the reason Winnovative converter to not be able to find the image, because src is not direct image path but uses MVC? Is there any workaround on this?
Can you modify the image links at runtime? If you can do that then I would suggest that you download all images to a temp folder configured to handle static content and point your references there. This is probably an authorization issue.

How to get external images into dreamweaver panel

my question is incredibly simple yet I haven't been able to find an answer online. I made a small image in photoshop and am trying to incorporate it in my current website. I don't know how to get the image into dreamweaver into the image folder in the dreamweaver panel.
You can copy the image into the image directory of your root folder and simply add the markup where you want to add the image.
<img src = "[your image link]" />
Or simply add the images using the files panel- Insert->Images->Select your image then press ok.
try the following
1- ctrl + Alt + I and choose your image from the dialog
2- copy manually the image you created to the website directory on your hard drive
hope this hepls!
Your image folder should be stored locally on your machine in your site-root folder.
In Photoshop: Save for Web Devices, Navigate to the Root Folder where your site is stored, Open Image Folder and Save Image in that location.
In Dreamweaver: Go to Files Panel, hit refresh button and the image should now appear in the images folder.
The easiest way to do this by far is too put your cursor on the part of the page you'd like you picture to reside.
Then using the top menus click "Insert" and then "Image", once you have done this you'll be able to find your image on your local computer or network and you will be prompted to save it to your site with the site directory already up - then just choose where to save your file.
It's best practice to save all images into the images folder.
Hope that helps!

How to add an external stylesheet/js file to a UIWebView without having it stored?

I want to change some CSS properties and HTML content from a random web, so I download and save the html file in the device and load it in a UIWebView to modify it.
The problem occurs when the html has referenced stylesheet/javascript files and they aren't loaded in the UIWebView.
Is there a way to access automatically to these files?
I've thought of getting the path through javascript and add the web url to it, and then download... but first I'll have to check if the path is relative or absolute and that...
Is there an easy and clean way to do this?
(I have the same problem with the images that are not url linked...)
Any idea would be appreciated :)

How to change logo in Joomla template, Entropy?

First time using Joomla and having a big issue. I was able to locate the css files that contains the background image url for the logo but i can't find the path that the css is referring to:
(../images/logo/style3/logo.png)
I am using the Entropy them by RocketThemes.
Your logo path is : /templates/rt_entropy_j15/images/logo/style3/logo.png
The urls that you found are are relative. The url of your image is therefore relative to the location of the css file you found. The ../ means go up one level - so instead of /templates/rt_entropy_j15/css/ (the location of the css file you are examining), one level up is /templates/rt_entropy_j15/ then go into the /images/ sub-folder (within /templates/rt_entropy_j15/ ) then navigate the /logo/style3/ folder tree and find your logo.png in place.
Firebug or similar debugging tools are always the best way to work through these kinds of problems.

Silverlight: Image Source with no file extension doesn`t display

In my Silverlight project, images for which the source URI does not contain the file extension don`t display, although the documentation says it should.
I set the image source like so:
imgCompanyLogo.Source = new BitmapImage(new Uri(Application.Current.Host.Source, "/Files/" + logoName));
Now, if "logoName" contains the file extension (like ".png" for example), the image is displayed fine, but it simply doesn't if the file is stored without an extension.
This seems to contradict the documentation here which states:
"The format-specific filename extensions such as .png are not necessarily required to be in the URI naming, but if the retrieved file is not determined to be a valid image format, a runtime exception is thrown."
I'm not getting any runtime exception either.
Is this a known issue or am I missing something simple?
Thanks!
PS: Just a little twist, the images display fine while debugging, not when the system is deployed...
I've made some test and the problem seems to be due to the response from the server.
If you try using .png within your project with a Build Action sets to Resource, both images will load regardless the extension.
Now if you try with images hosted on a server, it won't have the same behavior. Actually, if you try to browse the link to an image without extension directly in your browser, it will result in something else. On Chrome it will download the file, and on IE it will display the result as plain text.
That's because of the MIME type. A png should be returned with the type image\png.
There is a trick with .htaccess to set up the MIME-type but you need to have to specify for which extension. It works like this:
AddType image\png yourExtension [Extension2] [Extension3] ..
And if you want to see if why the image didn't load on your Image control, you can add an eventhandler to the ImageFailed event:
<Image Source="..." ImageFailed="Image_ImageFailed" />
But the error message that you will see is not really helpful:
ErrorException = {System.Exception: AG_E_NETWORK_ERROR}

Resources