User-520535568 posted
HI, I have a datalist which displays a list of staff, when a row is selected a Panel appears showing more details. This is the code that fires the Panel (Panel2):
Protected Sub MoreBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Panel1.Visible = False
Panel2.Visible = True
End Sub
Then I grab the details from the datalist and show them in Panel2 like this:
Protected Sub DataList4_ItemCommand(source As Object, e As DataListCommandEventArgs)
If e.CommandName = "Link" Then
Dim label1 As Label = DirectCast(DataList4.Items(e.Item.ItemIndex).FindControl("Label1"), Label)
Dim label2 As Label = DirectCast(DataList4.Items(e.Item.ItemIndex).FindControl("Label2"), Label)
Dim label3 As Label = DirectCast(DataList4.Items(e.Item.ItemIndex).FindControl("Label3"), Label)
Dim label4 As Label = DirectCast(DataList4.Items(e.Item.ItemIndex).FindControl("Label4"), Label)
Dim label5 As Label = DirectCast(DataList4.Items(e.Item.ItemIndex).FindControl("Label5"), Label)
UserNameBox.Text = label1.Text
PostBox.Text = label2.Text
SectionBox.Text = label3.Text
ServiceBox.Text = label4.Text
PhotoBox.Text = label5.Text
End If
End Sub
This all works fine but what I'd also like is to show the corresponding photo in Panel2 alongside the details.
I've tried passing the photo URL into the Panel via PhotoBox.Text but obviously this just shows the path to the photo.
Any help is much appreciated.