943,871 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 29585
  • ASP.NET RSS
Aug 5th, 2004
0

Use of Image control on Web Page

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
snufse is offline Offline
8 posts
since Jul 2004
Jun 24th, 2005
0

Re: Use of Image control on Web Page

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 Switch_Image (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!

Quote originally posted by snufse ...
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".
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: DataGrid: Edit mode, the index of a dropdownlist does not start at the right Value
Next Thread in ASP.NET Forum Timeline: Help with Databinding





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC