Very Strange Error

G

Guest

Hi,

I have a client side srcipt control that is giving me some very strange
problems when my Master.Page is layed out using <DIV> tags for the UI layout.
When it is layedout in a <TABLE> style fashion i have no issues.

I do a RegisterClientScriptInclude for the .js files in the code behind of
the master.
This has no problems my scripts are loaded fine.

Were i am seeing the issue is in a loop on the client side script that
determines the
location of the control that activated the client side function call.

It seems to loop only 3 tiems then looses its value set by 'activatorCtl'
which maintains its
value the whole time.

Thanks,
Ron

This is what the loop looks like.

// determine position of activator and where to show the popup

var leftpos = 0;
var toppos = 0;
var aTag = activatorCtl;

do {
aTag = aTag.offsetParent;
leftpos += aTag.offsetLeft;
toppos += aTag.offsetTop;
} while (aTag.tagName != 'BODY');


This is my Master.Page HTML markup

<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head" runat="server">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252" />
<title>Untitled Page</title>
<script type="text/javascript">
/* <![CDATA[ */
function AdjustColumnsHeight()
{
// get a reference to the three DIVS that make up the columns
var centerCol = window.document.getElementById('sk_centercol');
var leftCol = window.document.getElementById('sk_leftcol');

// calculate the max height
var hCenterCol = centerCol.offsetHeight;
var hLeftCol = leftCol.offsetHeight;
var maxHeight = Math.max(hCenterCol, hLeftCol);
// set the height of all 3 DIVS to the max height
centerCol.style.height = maxHeight + 'px';
leftCol.style.height = maxHeight + 'px';
// Show the footer
window.document.getElementById('sk_footer').style.visibility =
'inherit';
}
window.onload = function() { AdjustColumnsHeight(); }
/* ]]> */
</script>
</head>
<body>
<form id="Main" runat="server">
<div id="sk_header">
<div id="sk_header2">
<div id="sk_headermenu">
</div>
</div>
</div>
<div id="sk_container">
<div id="sk_container2">
<div id="sk_centercol">

<div id="sk_centercolcontent">
<asp:ContentPlaceHolder ID="MainContent"
runat="server" />
</div>
</div>
</div>
<div id="sk_leftcol">
<asp:Menu ID="menuMain" runat="server" BackColor="#F7F6F3"
DynamicHorizontalOffset="-2"
Font-Names="Verdana" Font-Size="12px"
ForeColor="#000000" StaticSubMenuIndent="10px"
DataSourceID="dsSiteMap" Width="170px">
<StaticMenuItemStyle HorizontalPadding="5px"
VerticalPadding="2px" />
<DynamicHoverStyle BackColor="#7C6F57" ForeColor="White"
/>
<DynamicMenuStyle BackColor="#F7F6F3" />
<StaticSelectedStyle BackColor="#5D7B9D" />
<DynamicSelectedStyle BackColor="#5D7B9D" />
<DynamicMenuItemStyle HorizontalPadding="5px"
VerticalPadding="2px" />
<StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
<DynamicItemTemplate><%# Eval("Text")
%></DynamicItemTemplate>
</asp:Menu>
<asp:SiteMapDataSource ID="dsSiteMap" runat="server" />

<asp:ContentPlaceHolder ID="LeftContent" runat="server" />

<div id="sk_bannerbox">
</div>
</div>
</div>
<div id="sk_footer">
<div id="sk_footertext">

</div>
</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

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top