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
 
Ad

Advertisements

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top