Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help: using RegisterClientScriptBlock #2

Reply
Thread Tools

Help: using RegisterClientScriptBlock #2

 
 
Mark
Guest
Posts: n/a
 
      10-16-2003
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


 
Reply With Quote
 
 
 
 
Mark
Guest
Posts: n/a
 
      10-17-2003
I seem to have figured it out............

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




"Mark" <> wrote in message
news:...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP: Spawning Multiple Browsers Using RegisterClientScriptBlock kewl ASP .Net 2 03-14-2006 10:05 PM
remove script registered using RegisterClientScriptBlock Steve Powell ASP .Net 3 06-21-2005 08:41 AM
Error using RegisterClientScriptBlock Steven K ASP .Net 2 04-14-2004 05:41 PM
RegisterClientScriptBlock to register OUTSIDE form tags Wes Weems ASP .Net 1 07-19-2003 07:04 PM
Re: RegisterClientScriptBlock & RegisterStartupScript revisited Brian W ASP .Net 1 07-04-2003 01:43 AM



Advertisments
 



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