How do I open an Image and load it to a "picturebox" in ASP

R

Rishi Boparai

Hi,

in Visual Studios there's this tool called PictureBox rite...but in
Visual Web developer i can't seem to find it..

i'm using Visual Web Developer...VB language..to make a watermarking
script so firstly i need to be able to load the picture i want to the
page first..

in VS the code is
Private Sub BrowseToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BrowseToolStripMenuItem.Click

OpenFileDialog1.Title = "Select an image ..."

OpenFileDialog1.Filter = "JPEG files|*.jpg" + "|Enhanced Windows
MetaFile|*.emf" + "|Exchangeable Image File|*.exif" + "|Gif Files|
*.gif|Icons|*.ico|Bitmap Files|*.bmp" + "|PNG Files|*.png|TIFF Files|
*.tif|Windows MetaFile|*.wmf"
OpenFileDialog1.FilterIndex = 1

OpenFileDialog1.FileName = ""

OpenFileDialog1.ShowDialog()

SourceFile = OpenFileDialog1.FileName.ToString()

PictureBox1.Image = Image.FromFile(SourceFile)
SourceFile = Me.OpenFileDialog1.FileName

Watermark.OpenImage(OpenFileDialog1.FileName.ToString)

End Sub

I know OpenFileDialog is used in VS and FileUpload is used in VWD
instead..

So wad so ihave to use in VWD instead of PictureBox?

Basically how do i open the image and load it to a "PictureBox"??

PLZ help..Advance thanks
 
P

Peter Bucher [MVP]

Hello Rishi
So wad so ihave to use in VWD instead of PictureBox?

Basically how do i open the image and load it to a "PictureBox"??
OpenFileDialog doesnt exists in ASP.NET Environment.
User FileUpload instead.

Also a PictureBox isnt available. Use a Image Control or simply an <img....
Tag instead.

There are several differences between an web- or desktopapplication,
be sure to care about these differences to avoid further problems.
 

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top