the problem is that ImageName comes from the selected listbox..
however I solved the problem..
I added the if Not page.IsPostback clause on the page load event
which is now like this
If Not Page.IsPostBack Then
Me.ListBoxDoc.DataSource = Getfiles(Request.PhysicalA
Me.ListBoxDoc.DataBind()
Me.ListBoxImages.DataSourc
Me.ListBoxImages.DataBind(
End If
and I am able now to get the selectedbalue from the listbox
however now the question is open so if you or any other experts have a better solution, I will be glad to learn
Main Topics
Browse All Topics





by: divinewind80Posted on 2007-11-09 at 13:08:20ID: 20253076
If you are trying to set the URL of the imagebutton to the selection in the listbox, why not just set it in the OnClick event of your ButtonLoadImageUrl button? The effect would be the same. It seems to me you are separating one thing into two... Try moving your code to as follows:
yVal sender As Object, ByVal e As System.EventArgs) Handles ButtonLoadImageUrl.Click
nPath & "Images/Uploaded/" & ListBoxDoc.SelectedValue.T oString
Protected Sub ButtonLoadImageUrl_Click(B
If ImageName <> "" Then
Me.LabelImageUrl.Text = Request.PhysicalApplicatio
Else
Me.LabelImageUrl.Text = "No image has been selected from the list"
End If
End Sub