possible to use <link type="image/gif" href=... ?

P

PJ6

Embedded javascript can be served from a DLL with an include that uses a
special URL generated by the Page.ClientScript.GetWebResourceUrl method at
runtime. For example:

<script
src="/DEV-WEB/WebResource.axd?d=Fzr7sc4IZAELIE4FCpgaNkpd1YgQqgig1EfiFj9_b7U1&t=633202779231250800"type="text/javascript"></script>

.... so can style sheets:

<link rel="stylesheet" type="text/css"
href="/DEV-WEB/WebResource.axd?d=Fzr7sc4IZAELIE4FCpgaNj0haxMo-mjcdCmEaAxjaHk1&t=633202779231250800">

I want to also include embedded gifs in this way, like so:

<link type="image/gif"
href="/DEV-WEB/WebResource.axd?d=Fzr7sc4IZAELIE4FCpgaNkJ0ekvCovLIod-OmabkTCyUFnTKnVWSg0GFZIn388TN0&t=633202779231250800">

Only, I can't get this one to work. I'm not sure it can work. Is it possible
to "include" gif images?

Paul
 
B

bruce barker

yes. be sure the mime type is correct when you call GetWebResourceUrl.

-- bruce (sqlwork.com)
 
G

Guest

No. the only way to "include" an image in a web page is to display it with an
<img ../> tag.
Peter
 
P

PJ6

Everything is correct (I verified that an image is indeed coming back from
the generated URL)... only, LINK appears not to "serve" the name of the
image and make it available for use in the rest of the document. So this
does not work -

<img src=SomeRandomImage.gif/>

which is a little surprising given that LINK does transparently serve the
contents of CSS files.

I thought maybe I could get around this problem by actually specifying the
name of the resource

<link name="SomeRandomImage.gif" type="image/gif"
href="/DEV-WEB/WebResource.axd?d=Fzr7sc4IZAELIE4FCpgaNgnSh6uI9n7nTeD4vNZ467J2YQUYK95_fTYYUJ8v4z6H0&t=633202835996676084">

Again, zip. A reference to SomeRandomImage.gif returns nothing.

This does work, of course -

<img
src=/DEV-WEB/WebResource.axd?d=Fzr7sc4IZAELIE4FCpgaNgnSh6uI9n7nTeD4vNZ467J2YQUYK95_fTYYUJ8v4z6H0&t=633202835996676084/>

but doing it this way means that I must abandon keeping the image reference
in an embedded CSS file, but rather emit the link at runtime to everything
that needs it, which I don't like.

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top