This is a migrated thread and some comments may be shown as answers.

when value is empty

1 Answer 40 Views
Menu
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 06 Nov 2010, 06:54 AM
hi

I am trying to load a default image if there isn't any value in the radmenu during page load. how do i test whether any value are present in the radmenu? Thanks

Protected Sub RadMenu1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMenuEventArgs) Handles RadMenu1.ItemDataBound
        If e.Item.Value Is Nothing Then
            imgPhoto.ImageUrl = "~/image/NoPhotoAvailable.jpg"
        Else
            imgPhoto.ImageUrl = e.Item.Value
        End If

End Sub

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 08 Nov 2010, 01:30 PM
Hi L,

Your code looks fine. Do you have any problems with it?

Best wishes,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Menu
Asked by
L
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or