formating display of javascript dropdown menu(script is in user control)

Discussion in 'ASP .Net' started by Phl, Jul 26, 2004.

  1. Phl

    Phl Guest

    hi,

    does any know why my javascript dropdownlist in my user control will
    only appear if I have my code as follows:

    // create an instance of the user control
    Control UCAdminDDMenu = LoadControl("AdminDropDownMenu.ascx");
    // add it to the pages controls
    Page.Controls.Add(UCAdminDDMenu);

    Problem is that my javascript dropdownlist is displayed after
    everything else has been displayed. I want it to be the first thing to
    be displayed. I have tried adding it to a panel, which seems to ruin
    everything all together(nothing gets displayed) . I have tried doing a
    Page.Control.Addat(1,UCAdminDDmenu) but nothing gets displayed at all
    either. Here is my Java Dropdownlist:

    Thanks


    <%@ Control Language="c#" AutoEventWireup="false"
    Codebehind="GenericDropDownMenu.ascx.cs"
    Inherits="Timesheet.GenericDropDownMenu"
    TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
    ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

    <HTML>
    <HEAD>
    <title>WebForm1</title>
    <!----------Menu 1 starts here---------->
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="C#" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5"
    name="vs_targetSchema">
    <!-- To link to your style sheet use this code -->
    <LINK href="TimesheetStyes.css" type="text/css" rel="stylesheet">
    <meta http-equiv="Content-Language" content="en-gb">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- A Java script function that generates the drop down menu and
    hover-->
    <script type="text/javascript"><!--//--><![CDATA[//><!--
    startList = function()
    {
    if (document.all&&document.getElementById)
    {
    navRoot = document.getElementById("nav");
    for (i=0; i<navRoot.childNodes.length; i++)
    {
    node = navRoot.childNodes;
    if (node.nodeName=="LI")
    {
    node.onmouseover=function()
    {
    this.className+=" over";
    }
    node.onmouseout=function()
    {
    this.className=this.className.replace(" over", "");
    }
    }
    }
    }
    }
    window.onload=startList;

    </script>
    </HEAD>
    <body>
    <form>
    <div id="content" style="Z-INDEX: 200; WIDTH: 61.8em; POSITION:
    absolute; HEIGHT: 40px">
    <hr>
    <ul id="nav">
    <li id="first">
    <div><a href="">User</a></div>
    <ul>
    <li>
    <a href="/Timesheet/timeentry.aspx">Add/Modify Entries</a>
    </li>
    <li>
    <a href="">Edit Profile</a>
    </li>
    </ul>
    </li>
    <li>
    <div><a href="">Manager</a></div>
    <ul>
    <li>
    <a href="">List Unapproved Timesheets</a>
    </li>
    <li>
    <a href="">Approve Timesheets</a>
    </li>
    </ul>
    </li>
    <li id="last">
    <div><a href="">Administrator</a></div>
    <ul>
    <li>
    <a href="/Timesheet/UserProfile.aspx">Add New User</a>
    </li>
    <li>
    <a href="">Modify Permissions</a>
    </li>
    </ul>
    </li>
    </ul>
    <hr>
    </div>
    </form>
    </body>
    </HTML>
     
    Phl, Jul 26, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miguel Dias Moura
    Replies:
    3
    Views:
    4,399
    Bruno Sirianni
    Apr 3, 2004
  2. Mike
    Replies:
    1
    Views:
    847
  3. empire5
    Replies:
    1
    Views:
    602
    =?Utf-8?B?UmVuZ2E=?=
    Jan 11, 2007
  4. shantanu
    Replies:
    0
    Views:
    159
    shantanu
    Aug 17, 2005
  5. Jerry C

    asp:Menu, DynamicItemTemplate and formating text

    Jerry C, May 2, 2007, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    640
    Jerry C
    May 4, 2007
Loading...

Share This Page