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

P

Phl

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top