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("Ad minDropDownMenu .ascx");
// add it to the pages controls
Page.Controls.A dd(UCAdminDDMen u);
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(nothin g gets displayed) . I have tried doing a
Page.Control.Ad dat(1,UCAdminDD menu) but nothing gets displayed at all
either. Here is my Java Dropdownlist:
Thanks
<%@ Control Language="c#" AutoEventWireup ="false"
Codebehind="Gen ericDropDownMen u.ascx.cs"
Inherits="Times heet.GenericDro pDownMenu"
TargetSchema="h ttp://schemas.microso ft.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="Micros oft Visual Studio .NET 7.1" name="GENERATOR ">
<meta content="C#" name="CODE_LANG UAGE">
<meta content="JavaSc ript" name="vs_defaul tClientScript">
<meta content="http://schemas.microso ft.com/intellisense/ie5"
name="vs_target Schema">
<!-- To link to your style sheet use this code -->
<LINK href="Timesheet Styes.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.getEle mentById)
{
navRoot = document.getEle mentById("nav") ;
for (i=0; i<navRoot.child Nodes.length; i++)
{
node = navRoot.childNo des[i];
if (node.nodeName= ="LI")
{
node.onmouseove r=function()
{
this.className+ =" over";
}
node.onmouseout =function()
{
this.className= this.className. replace(" over", "");
}
}
}
}
}
window.onload=s tartList;
</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="">Adminis trator</a></div>
<ul>
<li>
<a href="/Timesheet/UserProfile.asp x">Add New User</a>
</li>
<li>
<a href="">Modify Permissions</a>
</li>
</ul>
</li>
</ul>
<hr>
</div>
</form>
</body>
</HTML>