473,503 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help: using RegisterClientScriptBlock #2

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
Nov 17 '05 #1
1 2786
I seem to have figured it out............

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


"Mark" <py*******@hotmail.com> wrote in message
news:vo************@corp.supernews.com...
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

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
34831
by: GrantS | last post by:
I am having a problem closing a popup window opened modally. When I try to close the window (when the user hits save button and the data has been processed), the Popup window opens as a full screen...
2
1978
by: Earl Teigrob | last post by:
I have a Web Custom Control that builds javascript to write to the page. The DatePickerJs() function builds over 500 lines of javacript code. Even thought my Custom Web Control does not write it to...
2
7034
by: Kathy Burke | last post by:
I'm trying to use the following code to use a javascript return confirm. Cancel would exit the sub and return the page to its history (-2). OK would proceed with the asp.net code, i.e., run the...
6
6206
by: Rajan | last post by:
I have used RegisterClientScriptBlock in my ASP.NET page. it works well. Here I have problem. When Postback occurs, I dont want the script to be emitted. But It emits the Script even if I dont call...
5
1157
by: Dave | last post by:
I have a vb routine below where I'm trying to capture a name from a javascript prompt box. My application is inline VB on Visual Studio 2003. The prompt box does display, but when I type a...
1
3171
by: Jason Chan | last post by:
in asp.net 2.0, Page.RegisterClientScriptBlock is replaced by Client.RegisterClientScriptBlock function signature: Client.RegisterClientScriptBlock(Type, String, String) what should i put...
2
2795
by: kewl | last post by:
Hi All, We have an ASP.NET 2.0 (C#) intranet application that needs to spawn multiple browsers using RegisterClientScriptBlock. Here's what we got so far: // Go thru each datarow in the...
9
1360
by: Nathan Sokalski | last post by:
I have used the RegisterClientScriptBlock method in external functions of mine (ones that are saved in a separate *.vb file), where I use them as follows: Public Shared Sub MyFunction(ByVal...
4
12896
by: Nathan Sokalski | last post by:
I am working on converting my code from ASP.NET 1.1 to ASP.NET 2.0. In ASP.NET 1.1 the RegisterClientScriptBlock method was just a key and script (2 Strings), but in ASP.NET the...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.