473,748 Members | 8,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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("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>
Nov 18 '05 #1
0 1388

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3655
by: Mad Scientist Jr | last post by:
I don't know how this is happening, but a dropdown control I have is resetting to the 2nd value on the list anytime a postback occurs. I have no initiation code outside of If Not (IsPostBack) I have EnableViewState set to true for the control - the control stays populated, it just is losing its selected value. The control is not contained in any panels or anything, just a Web
1
1453
by: Yuriy | last post by:
I need to add images to dropdown control. I try to find something, but could not find anything exept ifragistic control. Any help appreciate
0
862
by: David | last post by:
Hi, If I put the dropdown control in a panel control, after I disable the container--panel control, I can still drop down the dropdown control. How can I disable a dropdown in a container? Thank you! David
2
2203
by: Electrified Research | last post by:
The new ASP.NET 2.0 Menu control seems to have some very cool features. But there are some things I don't like. Heavy implimentation of inline style. Some of which I cannot remove. The <a> tags all implement style="cursor:text". The stylesheet in the header begins to get larger and larger as you create a more complex menu and apply styles. I like the menu archatecture but what I want to do is two things: 1. REMOVE ALL STYLE...
2
1528
by: Spartaco | last post by:
I have a dropdown control into a page and a gridview, both are associated to two SqlDataSource controls, one of them is used to fill the DropDownControl, that is meant to be a filter over the query of the other SqlDatasource associated to the grid. This works fine, whenever I choose an item in the dropdown combo, I get a filtered grid. I did this using the declarative syntax, without writing any code. ok, now I want to put another item...
6
1673
by: clintonG | last post by:
I haven't learned this control yet but I do need to know if it can be configured to drop down instead of fly-out? // Like this... ------------------- Static Root Label ------------------- DropDown Item 1 DropDown Item 2
10
1991
by: Roy | last post by:
How do I read the value of an html input control from inside a javascript user control? An aspx page contains a user control that attempts to read a value from an html input control in the aspx page. For example: In the aspx page, the control is defined as: <input id="txtTMOStart" runat="server" name="txtTMOStart" type="TEXT"
0
1465
by: MikeB | last post by:
Hello All, I have UserControl that consists of a Menu control. When a user selects an item in the Menu I set a Public variable in the MenuItemClick event. My problem is that when the main webpage posts back, the MenuItemClick isn't fired off until after the postback so I can not get it and my SelectedCategoryID is always 0. Can anyone tell me what I am doing wrong? Below are snippets of my code: MENU.ascx private int _CategoryID...
5
1610
by: AG | last post by:
I realize that the obvious suggestion would be malware, but my definitions are up to date and I have already scanned for it. I have also tried disabling all IE add-ons. I just rebuilt and deployed my website (WAP) in ASP.NET 2.0. Everything is working fine except from my development machine with IE6. The master page contains a Menu control bound to a SiteMapDataSource. There is also a row of links (plain links, no menu control) at the...
0
819
by: Sasi Rekha | last post by:
Hi I have a menu control in asp.net with 4 child items. I nees to fire some javascript when click on the first child item of the menu. Could any one help me out ASAP? Thanks.
0
8823
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9312
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9238
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.