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

Menu to drive label and Image details

1 Answer 42 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 06 Oct 2009, 06:00 PM
I have a RadMenu that is loaded via a Linq to SQL class in div "RadMenu1".  In div2 I want a Title field (a label) and a AspImage to be loaded when a user selects a link from the RadMenu.

My Table currently looks like this:
idProject
projLink
projTitle
projImage

Example:
<div id="RadMenu1">
Link1  (id=idProject, Text=projLink)
Link2  (id=idProject, Text=projLink)
Link3  (id=idProject, Text=projLink)
</div>

<div id="div2">
Title  (id=idProject, Text=ProjTitle)
Image  (id=idProject, ImageUrl=projImage)
</div>


I am currently loading my RadMenu like this:
ClassesDataContext db = new ClassesDataContext();
                var prod = from p in db.ProjectImages
                           select p;

                RadMenu1.DataSource = prod;
                RadMenu1.DataFieldID = "idProjects";
                RadMenu1.DataTextField = "projLink";
                RadMenu1.DataValueField = "idProjects";
                RadMenu1.DataBind();

This is where I am stuck. How do I load the corresponding Label and ASPImage on click of one of the RadMenu Items?

1 Answer, 1 is accepted

Sort by
0
Vesko
Top achievements
Rank 2
answered on 08 Oct 2009, 01:30 PM
You should update the label and the Image control in the ItemClick server event of the menu. Just subscribe to it and it will fire once you click on a menu item.

Hope this helps.
Tags
Menu
Asked by
Chris
Top achievements
Rank 1
Answers by
Vesko
Top achievements
Rank 2
Share this question
or