How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET
Go Back  Xtreme Visual Basic Talk > > > How can i display an image in an ImageBox in ASP.NET


Reply
 
Thread Tools Display Modes
  #1  
Old 03-28-2007, 09:23 AM
zoul1380's Avatar
zoul1380 zoul1380 is offline
Junior Contributor
 
Join Date: Aug 2002
Location: Philippines
Posts: 230
Question How can i display an image in an ImageBox in ASP.NET


How can i display an image which is specified in my PC in an IMAGEBOX in ASP.NET here is my code.

Assume that there is 10 Jpg File in my specified Directory.

Please Help Me thanks.. im just a newbie on ASP.NET


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack = False Then
GetFiles()
End If
End Sub

Private Sub GetFiles()

Dim JPGFile() As String = System.IO.Directory.GetFiles("C:\Documents and Settings\rom\My Documents\My Pictures\Test", "*.jpg")
Dim x As Integer

For x = LBound(JPGFile) To UBound(JPGFile)
Response.Write(JPGFile(x) & "<BR>")
Next

Image1.ImageUrl = JPGFile(1).ToString

End Sub
Reply With Quote
  #2  
Old 03-28-2007, 10:30 AM
wayneph's Avatar
waynephHow can i display an image in an ImageBox in ASP.NET wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

What I'd do is create a panel on your page. Then in your loop create an instance of the Image object and set the ImageURL property to the file name. Then you can add it to the control array of the panel.

That being said, if you're going to be running this from a remote computer, you can't use images from the Documents and Settings folder. You need to make sure that it's available in a web share. Most of the time it's set up in c:\Inetpub\wwwroot\.
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #3  
Old 03-30-2007, 11:09 AM
MKoslof's Avatar
MKoslofHow can i display an image in an ImageBox in ASP.NET MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Can you store the images in a relative server directory and then provide access to this virtual folder in your web config, i.e:

Code:
<location path="Images">
    <system.web>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET
 
How can i display an image in an ImageBox in ASP.NET
How can i display an image in an ImageBox in ASP.NET
 
-->