954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Use of Image control on Web Page

I have a web page that will display an image (ie a logo).
I am using the following code but the image is not being displayed in the image control.

Image1.ImageUrl = "C:\logo.jpg".

Thanks.

snufse
Newbie Poster
8 posts since Jul 2004
Reputation Points: 10
Solved Threads: 0
 

Ok a few things. What web browser are you using to view it in? Is the browser set to accept inline images? Is the image file name exactly as you have coded it (i.e. Not Logo.jpg, or LOGO.jpg, or logo.JPG)?? Try placing the Image in the same directory as your application, and change the code to Image1.ImageUrl = "logo.jpg" and see if that works.

Try looking at this LINK

Sub <strong>Switch_Image</strong> (Src As Object, Args As EventArgs)
  If MyImage.ImageURL = "aspnet2.gif" Then
    MyImage.ImageURL = "xhtml.gif"
  Else
    MyImage.ImageURL = "aspnet2.gif"
  End If
End Sub

<asp:Button Text="Switch Image" OnClick="Switch_Image" Runat="Server"/>
<asp:Image id="MyImage" Runat="Server"
  ImageURL="aspnet2.gif"
  ImageAlign="Top"/>


Hope this helps! :cool:I have a web page that will display an image (ie a logo).
I am using the following code but the image is not being displayed in the image control.

Image1.ImageUrl = "C:\logo.jpg".

Paladine
Master Poster
Team Colleague
824 posts since Feb 2003
Reputation Points: 211
Solved Threads: 27
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You