Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8282277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:19:04+00:00 2026-06-08T10:19:04+00:00

In default.aspx page, there is a user control side_menu.ascx. This is part of the

  • 0

In default.aspx page, there is a user control side_menu.ascx.
This is part of the code in side_menu.ascx

<script src="../library/scripts/side_menu.js" type="text/javascript"></script>
<script src="../library/scripts/side_menu_items.js" type="text/jscript"></script>
<script src="../library/scripts/side_menu_tpl.js" type="text/jscript"></script>

<script language="JavaScript" type="text/javascript">
 <!--
 new menu(SIDE_MENU_ITEMS, SIDE_MENU_POS, SIDE_MENU_STYLES);
 // -->
</script>

The function menu is defined in side_menu.js. SIDE_MENU_ITEMS is an array containing all the menu items and the path.

   var SIDE_MENU_ITEMS =[
["Administration", null,
    ["Report a Bug", "administration/bugs/report_bug.aspx"], // /TOrders/
    ["Bug Tracker", "administration/bugs/bug_tracker.aspx?fmtid=bugs"], // /TOrders/
    ["Feature Request", "administration/features/request_feature.aspx"], // /TOrders/
    ["Feature Tracker", "administration/features/feature_tracker.aspx"] // /TOrders/
]

When a menu item is clicked it, it loads the page /localhost/administration/bugs/whateverpage.aspx. This works fine. However, when a menu item is clicked the second time the path becomes /localhost/administration/bugs/administration/bugs/whateverpage.aspx. THE PATH is getting appended. I just cant figure out where to go and clear the array. When I click on the the menu item, the menu_onnclick() is called and this.item[id] is already populated with the wrong path. Not sure where to clear it.

Here are some of the function in side_menu.js

   function menu (item_struct, pos, styles) {
    this.item_struct = item_struct;
this.pos = pos;
this.styles = styles;
this.id = menus.length;
this.items = [];
this.children = [];

this.add_item = menu_add_item;
this.hide = menu_hide;

this.onclick = menu_onclick;
this.onmouseout = menu_onmouseout;
this.onmouseover = menu_onmouseover;
this.onmousedown = menu_onmousedown;

var i;
for (i = 0; i < this.item_struct.length; i++)
    new menu_item(i, this, this);
for (i = 0; i < this.children.length; i++)
    this.children[i].visibility(true);
menus[this.id] = this;
}

  function menu_add_item (item) {
var id = this.items.length;
this.items[id] = item;
return (id);
}  

function menu_onclick (id) {
var item = this.items[id];
return (item.fields[1] ? true : false);
}

    function menu_item (path, parent, container) {
this.path = new String (path);
this.parent = parent;
this.container = container;
this.arrpath = this.path.split('_');
this.depth = this.arrpath.length - 1;
// get pointer to item's data in the structure
var struct_path = '', i;
for (i = 0; i <= this.depth; i++)
    struct_path += '[' + (Number(this.arrpath[i]) + (i ? 2 : 0)) + ']';
eval('this.fields = this.container.item_struct' + struct_path);
if (!this.fields) return;

// assign methods   
this.get_x = mitem_get_x;
this.get_y = mitem_get_y;
// these methods may be different for different browsers (i.e. non DOM compatible)
this.init = mitem_init;
this.visibility = mitem_visibility;
this.switch_style = mitem_switch_style;

// register in the collections
this.id = this.container.add_item(this);
parent.children[parent.children.length] = this;

// init recursively
this.init();
this.children = [];
var child_count = this.fields.length - 2;
for (i = 0; i < child_count; i++)
    new menu_item (this.path + '_' + i, this, this.container);
this.switch_style('onmouseout');
}

function mitem_init() {
document.write (
    '<a id="mi_' + this.container.id + '_'
        + this.id +'" class="m' + this.container.id + 'l' + this.depth 
        +'o" href="' + this.fields[1] + '" style="position: absolute; top: '
        + this.get_y() + 'px; left: '   + this.get_x() + 'px; width: '
        + this.container.pos['width'][this.depth] + 'px; height: '
        + this.container.pos['height'][this.depth] + 'px; visibility: hidden;'
        +' background: black; color: white; z-index: ' + (this.depth + 10000) + ';" ' // changed this.depth to (this.depth + 10000)
        + 'onclick="return menus[' + this.container.id + '].onclick('
        + this.id + ');" onmouseout="menus[' + this.container.id + '].onmouseout('
        + this.id + ');window.status=\'\';return true;" onmouseover="menus['
        + this.container.id + '].onmouseover(' + this.id + ');window.status=\''
        + this.fields[0] + '\';return true;"onmousedown="menus[' + this.container.id
        + '].onmousedown(' + this.id + ');"><div class="m'  + this.container.id + 'l'
        + this.depth + 'i">' + this.fields[0] + "</div></a>\n"
    );
    this.element = document.getElementById('mi_' + this.container.id + '_' + this.id);

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T10:19:07+00:00Added an answer on June 8, 2026 at 10:19 am

    Change your array to:

    var url="http://"+window.location.hostname;
    var SIDE_MENU_ITEMS =[
        ["Administration", null,
            ["Report a Bug", url+"/administration/bugs/report_bug.aspx"], // /TOrders/
            ["Bug Tracker", url+"/administration/bugs/bug_tracker.aspx?fmtid=bugs"], // /TOrders/
            ["Feature Request", url+"/administration/features/request_feature.aspx"], // /TOrders/
            ["Feature Tracker", url+"/administration/features/feature_tracker.aspx"] // /TOrders/
        ]
    ];
    

    Or (The more general way for support the urls with port numbers such as http://localhost:51143/):

    function getUrl(){
        url = window.location.href.split('/');
        return url[0]+'//'+url[2];
    }
    var SIDE_MENU_ITEMS =[
        ["Administration", null,
            ["Report a Bug", getUrl()+"/administration/bugs/report_bug.aspx"], // /TOrders/
            ["Bug Tracker", getUrl()+"/administration/bugs/bug_tracker.aspx?fmtid=bugs"], // /TOrders/
            ["Feature Request", getUrl()+"/administration/features/request_feature.aspx"], // /TOrders/
            ["Feature Tracker", getUrl()+"/administration/features/feature_tracker.aspx"] // /TOrders/
        ]
    ];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a aspx page (default.aspx), inside which I am loading a user control
I have a user control loaded on the default.aspx page using the Control UControl
i try to load some user control on my Default.aspx page selecting dropdown control.
Script link on master page: <head runat=server> <script src=<%=ConfigurationManager.AppSettings[ApplicationURL].ToString()%>Scripts/jquery-1.7.2.js type=text/javascript language=javascript></script> </head> Default.aspx page
Got a Site.Master (Masterpage) Got Default.aspx (Page) And in the Default.aspx , there is
Ok, I have an default.aspx page that I'm trying to have redirect the user
I'm trying to display the page title (html title) on the default.aspx page of
I have an ASPX Page: <%@ Page Language=C# MasterPageFile=~/site.Master AutoEventWireup=true CodeBehind=Default.aspx.cs Inherits=myProject.Presentation.Web.Default src=Default.aspx.cs %>
I'm trying to analyze some running times for various methods in my default.aspx.cs page.
In an ASP.Net WAP, the home page /default.aspx is receiving periodic requests from I-know-not-where.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.