I have two separate .aspx files that are used in one web page. One for the header and the other for the body. In the javascript for the body file, how would I grab the value of an asp:label control from the header? It’s name is “lblName”, so I tried simply document.getElementById(“lblName”).value and I received the error:
Microsoft JScript runtime error: Object required
This site is written in Visual Basic, so I’m wondering if anyone knows how to do this from the code behind as well.
If I hit F12 in the browser (IE) this is the hierarchy I see:
<head>
<frameset rows="147,*" frameBorder="no" frameSpacing="0">
<frame name="frHeader" id="frHeader" src="DistHeader.aspx?statProducer=0707090003" noResize="noresize" scrolling="auto">
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
<html>
<head>
<body topMargin="1" rightMargin="0" bottomMargin="0">
<div class="clsNoPrint">
<div class="clsNoPrint">
<table width="100%">
<tbody>
<tr class="clsNameBar" width="100%">
<td width="*" align="left">
<span class="clsNameBar" id="lblName" style="width: 100%;">
Since this was a website that was created almost ten years ago, we had to go up the ladder in the frameset to get the value we were looking for. The code below was the method used