473,569 Members | 2,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help: using RegisterClientS criptBlock #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(javascrip t) 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="JavaS cript1.2" src="adds/menu/wm_code.js"
type="text/javascript"></script>
goes in between my <head> and </head> tags. While this one:
<script language="JavaS cript1.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
RegisterCliennt ScriptBlock.

Herer is the code I have for the ascx file:

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

this.RegisterCl ientScriptBlock ("myScript","<s cript
language="JavaS cript1.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="dodger blue">
<tbody>
<tr>
<td rowspan="3">
<p align="left">
<asp:Image id="logo" runat="server"
ImageUrl="image s/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:AdRotato r id="header" runat="server"
Width="360px" Height="40px"
AdvertisementFi le="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 2792
I seem to have figured it out............

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


"Mark" <py*******@hotm ail.com> wrote in message
news:vo******** ****@corp.super news.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(javascrip t) 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="JavaS cript1.2" src="adds/menu/wm_code.js"
type="text/javascript"></script>
goes in between my <head> and </head> tags. While this one:
<script language="JavaS cript1.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
RegisterCliennt ScriptBlock.

Herer is the code I have for the ascx file:

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

this.RegisterCl ientScriptBlock ("myScript","<s cript
language="JavaS cript1.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="dodger blue">
<tbody>
<tr>
<td rowspan="3">
<p align="left">
<asp:Image id="logo" runat="server"
ImageUrl="image s/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:AdRotato r id="header" runat="server"
Width="360px" Height="40px"
AdvertisementFi le="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
34845
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 as a new window. The original window plus the Modally opened Pop remain in a separate window. What I want to do is close the popup and return to...
2
1982
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 the client, it regenerates the string very time this control appears on a page. Is there a way to create this string ONCE and then just use if...
2
7041
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 Complete() sub. This is within a page that will take me quite a while to test, so I'd like to know if I've got this right beforehand. I think I'm...
6
6218
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 the RegisterClientScriptBlock How to prevent this?
5
1162
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 string and hit OK or Cancel, the value 'ret' which I want to hold the value of the string, is always empty. And the status bar always says "Done but...
1
3179
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 on the Type?
2
2805
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 datatable foreach (System.Data.DataRow drReportGroupsDetails in tableReportGroupsDetails.Rows) { // Get the needed values from the datatable string...
9
1372
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 txtbox As TextBox) 'other code txtbox.Page.RegisterClientScriptBlock("mykey","myscript") 'other code End Sub
4
12903
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 ClientScript.RegisterClientScriptBlock also includes a parameter called 'type' which is of Type. This sounds like it is supposed to specify whether the script is...
0
7698
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.