javascript can't manipulate an asp:label. The label doesn't
exist on the client side.
Actually, I did. Just prepend a _ctl0_ to asp:label ID and insert the
following in your javascript
:
GetObject('_ctl0_lblPrice').innerText='Hello There';
where lblPrice is the asp:label's ID.
And GetObject is a Javascript Function that simply finds that object in
DOM irrespective of the browser like:
-----------------------------------------------------------------------------
<script LANGUAGE="Javascript">
<!--
if (top.location != self.location){top.location = self.location;} //
get out of framed browsing
function onerror(){return(true);} // true turns off error
messages
var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;
if (document.getElementById){
isID = 1; isDHTML = 1;
}else{
if(document.all){
isAll = 1; isDHTML = 1;
}else{
browserVersion = parseInt(navigator.appVersion);
if((navigator.appName.indexOf('Netscape') != -1) && (browserVersion
== 4)){
isLayers = 1; isDHTML = 1;
}
}
}
function GetObject(objectID){
if(isID){return(document.getElementById(objectID)) ;}
if(isAll){return(document.all[objectID]);}
if(isLayers){return (document.layers[objectID]);}
return null;
}
//-->
</script>
-----------------------------------------------------------------------------
My question still remains please. How do I get ASP.Net to see the
updates that Javascript made to the lblPrice object. In the above
example, Javascript changed lblPrice value to 'Hello There'. How do I
get ASP.Net to see that change on the server side ?
Aladdin Nassar