Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Specifying images in ASP.NET page
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01434080
Message ID:
01434084
Vues:
31
>>Hi,
>>
>>I have a few images specified in an ASP.NET page. Here is one example how the image is specified:
>>
>>
>><asp:TableRow>
>>     <asp:TableCell VerticalAlign="Top" Width="88" RowSpan="2">
>>     <IMG src="images\MyImage.gif"></asp:TableCell>
>></asp:TableRow>
>>
>>
>>The strange thing is when I look at the page in design mode in VS 2005 the line "src ..." has a squiggly red underline. And I point the mouse on this line it say that "File images\MyImage.gif is not found" Yet, the image is there, in the IMAGES folder. What could be wrong in the way I specify the image?
>>
>>TIA.
>
>Depending on where the page is that the image is to be displayed upon, you likely need to specify src="~/images/MyImage.gif" to get a relative path from the site root.instead.

One thing I noticed now that you and I use different slashes. And I don't know which ones are correct <g>.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform