Help: using RegisterClientScriptBlock #2

M

Mark

I'm really pulling my hair out on this. (newbie at ASP.NET)

I have a control (called 'header.ascx' ) that I want to place a
DHTML(javascript) menu in. I keep getting errors.

The menu code is in 2 .js files (adds/menu/wm_code.js, and
adds/menu/wm_menu.js).
When written with html this snippet:
<script language="JavaScript1.2" src="adds/menu/wm_code.js"
type="text/javascript"></script>
goes in between my <head> and </head> tags. While this one:
<script language="JavaScript1.2" src="adds/menu/wm_menu.js"
type="text/javascript"></script>
goes where I want the menu to appear.

That works correctly.
But I had a problem using 'refresh' in the brower (cue to frames) so I want
to scrap the frames and use a web/user control.
I have read (and didn't really understand) MS articles on using
RegisterClienntScriptBlock.

Herer is the code I have for the ascx file:

<%@ Control Language="VB" %>
<script runat="server">
Sub Page_Load(sender as Object, e as EventArgs)

this.RegisterClientScriptBlock("myScript","<script
language="JavaScript1.2" src="adds/menu/wm_menu.js"
type="text/javascript"></script>");

End Sub


</script>
<p align="center">
<table height="90" width="100%" align="center" bgcolor="dodgerblue">
<tbody>
<tr>
<td rowspan="3">
<p align="left">
<asp:Image id="logo" runat="server"
ImageUrl="images/logo_wm.gif" ImageAlign="Top"></asp:Image>
</p>
</td>
<td valign="center" align="left" width="50%" colspan="2"
height="50" border="0">
</td>
</tr>
HERE IS WHERE i WANT THE MENU!!!!!!!!!!!!!!!!!!!!!!!!!!
<tr>
<td valign="center" width="50%" colspan="2" height="40"
rowspan="2" border="0">
<p align="center">
<asp:AdRotator id="header" runat="server"
Width="360px" Height="40px"
AdvertisementFile="adds/headerads.xml"></asp:AdRotator>
</p>
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
</p>

I keep getting this error when viewed via IE:

Name 'this' is not declared. (from line 5 in the above file.0
What am I doing wrong and how can I get the menu to appear where I want it?
(In caps in the above code)

Thanks again,
Mark
 
M

Mark

I seem to have figured it out............

Thanks anyway, please disregard... Unless you have any good tips! lol.....
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top