Question : ClientScript.RegisterStartupScript not working

I have a javascipt stored in an external flie.  I include it in my master page using the following HTML code
<script type="text/javascript" src="../_jsp/pubscriptsVer2.jsp">
  </script>

Then I use the following code in a child page to get the script to execute when the page finishes loading.
 Page.ClientScript.RegisterStartupScript(GetType(Page), "", "OnInitial();", True)

In IE7 this works fine.  In IE8/ FireFox it does not.  However if in my child page I past the script code in the head of the doc, it works just fine.    I've attached a copy of the javascript.  Any help would be greatly appreciated.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
var nSubtopics;
var nTopics;
var aTopicText;
var aTopicValue;
var aSubtopicText;
var aSubtopicValue;
var nSelectedTopic;
var nSelectedSubtopic;
function OnInitial() 
{
//debugger;;
	var i, j, n, strTopic, strSubtopic;

	nTopics =document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").options.length; 
	aTopicText = new Array(nTopics);
	aTopicValue = new Array(nTopics);
	for (i=0; i< nTopics; i++)
	{
		aTopicText[i] = document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").options[i].text;
		aTopicValue[i] = document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").options[i].value;
	}
	nSubtopics = document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options.length; 
	aSubtopicText = new Array(nSubtopics);
	aSubtopicValue = new Array(nSubtopics);
	for (i = 0; i < nSubtopics; i++) {
		aSubtopicText[i] = document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options[i].text;
		aSubtopicValue[i] = document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options[i].value;
	}
	nSelectedTopic = document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").selectedIndex;
	nSelectedSubtopic = document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").selectedIndex;
	if (nSelectedTopic == 0) {
		document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options.length = 1;
	}
	else {
		strTopic = document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").options[nSelectedTopic].text;
		n = strTopic.length;
		j = 0;
		for (i = 1; i < nSubtopics; i++) {
			strSubtopic = aSubtopicValue[i];
			if (strTopic != strSubtopic.substring(0, n)) 
			{
				document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options[i - j] = null;
				j++;
			}
		}
	}
}

function OnChangeTopic() 
{ var i, j, n, strTopic, strSubtopic,strSubtopicVal; 
 
	if (nSelectedTopic != document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").selectedIndex) 
	{ 
                
              
		nSelectedTopic = document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic").selectedIndex; 
                 strTopic = 	document.getElementById("_ctl0_ContentPlaceHolder1_ddlTopic")[nSelectedTopic].text; 
		
		document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options.length = 1; 
		if (nSelectedTopic != 0) 
		{ 
			j =	1; 
			n = strTopic.length; 
			for (i = 1; i < nSubtopics; i++) 
			{ 
				//strSubtopic = aSubtopicValue[i]; 
				strSubtopic = aSubtopicText[i];
				strSubtopicVal = aSubtopicValue[i];
				if (strTopic == strSubtopic.substring(0, n)) 
				{ 
					document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").options[j] = new Option(strSubtopic.substring(n + 1, strSubtopic.length), strSubtopicVal); 
					if (nSelectedSubtopic == i) { 
						document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").selectedIndex = j; 
					} 
					j++; 
				} 
			} 
		} 
	} 
} 
function OnChangeSubtopic() 
{ var i, n, strSubtopic; 
	n = document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic").selectedIndex; 
	if (n == 0) 
	{ 
		nSelectedSubtopic = 0; 
	} 
	else 
	{ 
		strSubtopic = document.getElementById("_ctl0_ContentPlaceHolder1_ddlSubtopic")[n].value; 
		for (i = 1; i < nSubtopics; i++) 
		{ 
			if (strSubtopic == aSubtopicValue[i]) 
			{ 
				nSelectedSubtopic = i; 
				break; 
			} 
		} 
	} 
}

<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->

Answer : ClientScript.RegisterStartupScript not working

It is not the CSS, but the changes from IE7 to IE8.  However, you may try using a CSS class with Z-index since there is no corresponding attribute on the control that I know of.
Random Solutions  
 
programming4us programming4us