Solved

gif image not displayed in ASP.NET web page table cell

Posted on 2009-06-30
2
604 Views
Last Modified: 2012-08-13
When i use img tag in ASP.NET table cell, the image is not being displayed when I run the code.
However, the image is displayed if I paste the same code in a text file and change the extension to htm.
  If I am doing something wrong then how do we generally create a page in ASP.Net so that the image is displayed in the web page (with image in a html table cell).
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Yahoo My Page</title>
</head>
 
<body>
    <table style="width: 100%;" border="1";>
        <tr>
            <td><img src="C:\Users\vivek\Desktop\html_practice\yahoo\yahooimages\ma_mail_1.gif" alt="ma_mail_1.gif"/></td>
            
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
 
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
</html>

Open in new window

0
Comment
Question by:vivekcse1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
ibs06t earned 500 total points
ID: 24771612
in img tag give attribute

<img src="file:///C:\Users\vivek\Desktop\html_practice\yahoo\yahooimages\ma_mail_1.gif" alt="ma_mail_1.gif" />

using server control asp:image
<asp:image id="image1" runat="server" imageurl="~/images/mail.com" />


but my advice pl copy that image in application then use it. because these url not work in client machine or another machine

thanx
<img src="file:///C:\Users\vivek\Desktop\html_practice\yahoo\yahooimages\ma_mail_1.gif" alt="ma_mail_1.gif" />
 
<asp:image id="image1" runat="server" imageurl="~/images/mail.com" />

Open in new window

0
 
LVL 1

Expert Comment

by:ibs06t
ID: 24771631
<img src="file:///C:/Users/vivek/Deskto/\html_practice/yahoo/yahooimages/ma_mail_1.gif" alt="ma_mail_1.gif" />

using server control asp:image
<asp:image id="image1" runat="server" imageurl="~/images/mail.com" />


but my advice pl copy that image in application then use it. because these url not work in client machine or another machine

thanx


i changed slash (/) this correct code
<img src="file:///C:/Users/vivek/Deskto/\html_practice/yahoo/yahooimages/ma_mail_1.gif" alt="ma_mail_1.gif" />

Open in new window

0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question