Menu to drive label and Image details

2 posts, 0 answers
  1. Chris
    Chris avatar
    120 posts
    Member since:
    Jun 2006

    Posted 06 Oct 2009 Link to this post

    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:

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

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

    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";

    This is where I am stuck. How do I load the corresponding Label and ASPImage on click of one of the RadMenu Items?
  2. Vesko
    Vesko avatar
    122 posts
    Member since:
    Mar 2009

    Posted 08 Oct 2009 Link to this post

    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.
Back to Top