开发者

Unable to view the image in page [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form.开发者_开发问答 For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

Following is a piece of xsl code

<tr>
  <td class="colHeader1">Last Name
  </td>
  <td class="cellstyle1">
     <input type="text" name="srchLname" style="width:100%" tabindex="1"/>
  </td>
  <td class="colHeader1">Primary Telephone
  </td>
  <td class="cellstyle1">
     <input type="text"  name="srchPhone"  style="width:100%"></input>
  </td>
  <td rowspan="2" align="right">
    <img src="images/search.gif" style="cursor:hand" onclick="doCustSrch()"></img>
    <img src="images/clear.gif" style="cursor:hand" onclick="clearCustSrch()"></img>
  </td>
</tr>

On using this code the images doesnt showup in the page(search.gif,clear.gif)


this is not an ASP issue but rather a physical position one.

Let's imagine that you have this tree of contents:

|
|-- _Assets
|     |-- Css
|          |-- styles.css
|     |-- Scripts
|          |-- jquery.min.js
|     |-- Images
|          |-- search.gif
|          |-- clear.gif
|-- Admin
|     |-- default.asp
|-- Account
|     |-- default.asp
|-- ...
|

if you want to point to the search.gif image from Admin/default.asp your image localization will be:

  1. You are in the Admin folder, so let's go back one folder, positioning in the root

    ../

  2. Let's find the entire path from the root now

    _Assets/Images/Search.gif

  3. Join both paths

    <img src="../_Assets/Images/Search.gif" alt="" />

You you are using a CSS styling under styles.css your start position is the folder that holds the styles.css file and never the page where it's been called.

So, in your example, you should see if you have something like this:

|-- mypage.asp
|-- images
|     |-- search.gif
|     |-- clear.gif

I hope this helps you clear any wondering in pointing the files to and from where.


Just for your information, and I don't know if the old ASP uses the ~ char, but in ASP.NET we tend to use:

`<img src="~/_Assets/Images/Search.gif" alt="" />`

where the ~ wildcard char means "Root of website", so, no matter where we are, in a file under n child folders or in the root, the path is always the full path with the ~ char on the start.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜