Add onMouseOver Javascript Function to Asp.Net Dynamic Menu Items
<p>How do you add a mouseover javascript function to an asp.net menu item when the menu items are created dynamically? Doesn't allow you to add .attributes function.</p>

<p>[Javasript]</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function ChangeProjectImage(obj) {
        var ctrl = document.getElementById(obj.id);
        ...code...
    }
&lt;/script&gt;
</code></pre>

<p>[HTML - Menu Control]</p>

<pre><code>&lt;asp:Menu ID="Menu1" runat="server" Orientation="Vertical" Font-Names="Verdana" Font-Size="12px"
        CssClass="Menu"&gt;
&lt;/asp:Menu&gt;
</code></pre>

<p>[CodeBehind - Add menu items dynamically]</p>

<pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Me.IsPostBack Then

    Else
        Dim dt As DataTable = Session("dt")

        For Each dr As DataRow In dt.Rows
            Dim mi As New MenuItem(dr(0), dr(1), "images\folder_03.png")
            Menu1.Items.Add(mi)
        Next

    End If
</code></pre>
