I have a unique situation where I need to access the value of an asp:label control named "lblName" from one .aspx file in another. Specifically, I have a header file and a body file that are both used on the same web page. In the JavaScript code of the body file, I attempted to grab the value using document.getElementById("lblName").value, but encountered this error message:
Microsoft JScript runtime error: Object required
Since this site is coded in Visual Basic, I am also curious if there is a way to accomplish this task from the code behind.
Upon inspecting the hierarchy by pressing F12 in the browser (using IE), I observed the following structure:
<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%;">