473,800 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Different behaviour for hardcoded scripts and saved in a file

1 New Member
Hello,
I have a couple problems which I think they need attention from someone a bit more experienced in web developpement than I am.
I want to change the text of an ASP:Label (Server Side), every time the user hovers the mouse on a client-side object.
I manage to make that work with the script I attach below, however the problems raise when I try to make my code a bit more efficient.
Ideally, I'd like to parse the "S" variable to the server like that:
[b]document.getEle mentById('<%=Ma ster.ActiveLbl. ClientID%>').in nerText="'<%'" + s + "'%>'";[/B]

But as we probably all know this syntax is not possible to provide the realtime result I want. Then, if the ideal solution is not possible, I try to include my script in a JScript File so I will not have to hard code all of these Switch,Case in every page of my website. However, even though when they are hardcode, the following code works fine. When I load it with the JScript file, I get a 'document.getEl ementById(...)' is null or not an object runtime script error.
Any ideas???
Thank you in advance, the script's code follows...

<script type="text/javascript" >
<!--
function MouseOver(S)
{
var sStringToShow;
switch (S)

{
case "BuildingVa l": sStringToShow=' <%=MyAppData.Mo useOverBuilding Val%>';
break;
case "ContentVal ": sStringToShow=' <%=MyAppData.Mo useOverContentV al%>';
break;
case "PostCode":sStr ingToShow='<%=M yAppData.MouseO verPostCode%>';
break;
case "Tenancy": sStringToShow=' <%=MyAppData.Mo useOverTenancy% >';
break;
case "getQQuote" : sStringToShow=' <%=MyAppData.Mo useOvergetQQuot e%>';
break;
default: sStringToShow=S ;
}
document.getEle mentById('<%=Ma ster.ActiveLbl. ClientID%>').in nerText = sStringToShow;

}

function MouseOut()
{
document.getEle mentById('<%=Ma ster.ActiveLbl. ClientID%>').in nerText='<%=act iveLblContent%> ';
}
// -->
//change the text in an asp:Label from client side
</script>
Mar 5 '08 #1
0 822

Sign in to post your reply or Sign up for a free account.

Similar topics

7
2010
by: Timothy Madden | last post by:
Hello all I'm trying to include some files in an included file. Think of some scripts like this /index.php /scripts/logging.php /scripts/config.php /scripts/db_access.php
7
2167
by: Dave Smithz | last post by:
Hi There, I have taken over someone else's PHP code and am quite new to PHP. I made some changes and have implemented them to a live environment fine so far. However, I now want to setup a test environment. All the PHP scripts start with a few lines of: require_once "library file at specific location on server"
7
1360
by: Doug Rosser | last post by:
I'm writing a fairly complicated test framework and keeping configuration data inside ini files that are parsed at runtime by the ConfigParser module. For example, there would be a section similar to the following server1:{'hostname':'alpha','os':'posix'} server2:{'hostname':'beta','os':'win'}
4
6204
by: | last post by:
I have earlier used an HttpModule that did URL rewrites on the BeginRequest event. Now I am trying to use the same module in a different application on a new and upgraded machine (winxp sp2). The Module is registered via Web.config. The registration is OK. When asking for an existing .aspx page, the eventhandler is called as it should. HOWEVER - if the request url is for a non-existant file, I get a 404 - file
0
1750
by: Rhys666 | last post by:
Basically I have a link that opens my download page and the querystring identifies the type of 'template' Excel spreadsheet has asked to download. The download page reads the querystring, identifies the template required then uses Response.AppendHeader to amend the response to create the file download dialogue. On my local machine this works fine and the download dialogue correctly identifies the file name and type attempting to be...
27
2681
by: Ben Finney | last post by:
Antoon Pardon wrote: > I just downloaded your enum module for python > and played a bit with it. IMO some of the behaviour makes it less > usefull. Feedback is appreciated. I'm hoping to provide a "one obvious way" to do enumerations in Python. > >>> from enum import Enum > >>> day = Enum('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun')
3
7126
by: downwitch | last post by:
Hello, I've run as many keyword combinations searching for this as I can think of, but cannot find a simple answer. The situation: I have a database that is mid-conversion/redevelopment. I frequently rebuild my dev copy from the production version, which requires a bunch of DDL script, and then adding in all the stored procedures necessary to the new version only. Each sp may have changed since the last time it was run, so I can't...
2
1462
by: Dahak | last post by:
I may be having an attack of the stupids and my Google-foo is failing me today, but I can't seem to get past this problem. I have a script that indexes a directory and provides the user with a simple interface to select files to download. Once they've made their selection and submitted the form, the form action reloads the page.
8
5322
by: Dox33 | last post by:
I ran into a very strange behaviour of raw_input(). I hope somebody can tell me how to fix this. (Or is this a problem in the python source?) I will explain the problem by using 3 examples. (Sorry, long email) The first two examples are behaving normal, the thirth is strange....... I wrote the following flabbergasting code: #-------------------------------------------------------------
0
9691
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10505
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10276
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10035
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9090
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6813
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4149
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
3
2945
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.