hi
i have taken this code from one website. but it shows some errors.
here is the code.
These are some import statements.
Imports System.IO
Imports System.Drawing
Imports System.Drawing.Bitmap
Imports System.Drawing.Drawing2D
Imports System.Data
Imports System.Data.SqlClient
and here is the PageLoad event..
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Title = "USS Isherwood DD-520"
Dim files() As String
Dim i As Integer
files = Directory.GetFiles(Server.MapPath("~\Images"), "*.jpg")
If Page.IsPostBack Then
Me.imgMain.ImageUrl = Request.QueryString("Img")
End If
Dim arrIbs(files.Length) As ImageButton
For i = 0 To files.Length - 1
Dim image As New Bitmap(files(i).ToString)
arrIbs(i) = New ImageButton()
arrIbs(i).ImageUrl = files(i).ToString()
arrIbs(i).Width = 160
arrIbs(i).Height = 100
arrIbs(i).BorderStyle = BorderStyle.Inset
arrIbs(i).BorderWidth = 2
arrIbs(i).AlternateText = _
System.IO.Path.GetFileName(files(i).ToString())
arrIbs(i).PostBackUrl = "default.aspx?Img=" & _
files(i).ToString()
Me.pnlThumbs.Controls.Add(arrIbs(i))
Dim lbl As New Label
lbl.Text = "<br/>"
pnlThumbs.Controls.Add(lbl)
Next
End Sub
it shows ERROR at Me.pnlThumbs.Controls.Add(arrIbs(i))-- error of pnlThumbs
and at pnlThumbs.Controls.Add(lbl)--error of pnlThumbs
Me.imgMain.ImageUrl = Request.QueryString("Img")-- error of imgMain
it says "pnlThumb is not a member of _Default."
and "imgMain is not a member of _Default."
hoping for a good and quick reply..
thank you
Markand