T
tshad
I have an aspx window that is calling another window and I am trying to get
a couple of objects from the opening page. The problem is that I can't seem
to get anything inside of my form.
I have the following in my opener page:
<body id="myBody" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0" runat="server">
<form id="addForm" runat="server">
<asp:label id="theBox" text = "a test" runat="server"/>
<asplaceHolder ID="thePlaceHolder" runat="server"/>
</form>
</body>
The "thePlaceHolder" object is where I put my User object.
I am trying to get to some of the objects inside of this user object and if
I walk the Dom I can see some (but not all the objects).
I can't even seem to get to the "theBox" object which is one of the first
objects in the Dom. I tried to get the object like this:
function entry()
{
alert("On Entry");
var theObject = window.opener.document.getElementById('theBox');
alert("After Entry theObject = " + theObject);
alert("length = " + window.opener.document.addForm.length);
for (var i = 0;i< window.opener.document.addForm.length;i++)
{
alert("inside for loop i = " + i);
var e = window.opener.document.addForm.elements;
alert("e.type = " + e.type);
alert("e.name = " + e.name);
}
}
theObject ends up being null. If I move the "theBox" object outside of the
form, it seems to find it fine.
When I walk the Dom, the length is about 25 and I know there are about 200
objects on the page. Some of the objects are being shown inside of the User
control - but "theBox" doesn't show at all. And it is one of the first
ones.
The trace shows the first part of the objects as:
__PAGE ASP.ResumeSubmittalForm_aspx
_ctl1 System.Web.UI.LiteralControl
_ctl2 System.Web.UI.LiteralControl
MyStyleSheet System.Web.UI.HtmlControls.HtmlGenericControl
_ctl3 System.Web.UI.LiteralControl
myBody System.Web.UI.HtmlControls.HtmlGenericControl
_ctl4 System.Web.UI.LiteralControl
addForm System.Web.UI.HtmlControls.HtmlForm
_ctl5 System.Web.UI.LiteralControl
theBox System.Web.UI.WebControls.Label
_ctl6 System.Web.UI.LiteralControl
thePlaceHolder System.Web.UI.WebControls.PlaceHolder
_ctl0 ASP.mainPage_ascx
_ctl0:_ctl2 System.Web.UI.ResourceBasedLiteralControl
_ctl0:HomeLink System.Web.UI.WebControls.HyperLink
_ctl0:_ctl3 System.Web.UI.LiteralControl
_ctl0:MyInformationLink
System.Web.UI.WebControls.HyperLink
_ctl0:_ctl4 System.Web.UI.LiteralControl
_ctl0:ResumeLink System.Web.UI.WebControls.HyperLink
_ctl0:_ctl5 System.Web.UI.LiteralControl
_ctl0:CoverLetterLink
System.Web.UI.WebControls.HyperLink
_ctl0:_ctl6 System.Web.UI.LiteralControl
_ctl0assportLink System.Web.UI.WebControls.HyperLink
The Forms collection shows as:
__EVENTTARGET _ctl0:_ctl1reviewLink
__EVENTARGUMENT
__VIEWSTATE dDwzNj
_ctl0:_ctl1:resumes 0
ctl0__ctl1_ResumeText
ctl0__ctl1_CoverLetter
_ctl0:_ctl1:GenderList
_ctl0:_ctl1:EthnicityList
_ctl0:_ctl1:VeteranStatus
_sk_scrollkeepervalue 0!0
Where is the "theBox" control and when walking the Dom it show the length as
25.
What is going on?????
Is this a problem with asp.net 1.1????
Thanks,
Tom
a couple of objects from the opening page. The problem is that I can't seem
to get anything inside of my form.
I have the following in my opener page:
<body id="myBody" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0" runat="server">
<form id="addForm" runat="server">
<asp:label id="theBox" text = "a test" runat="server"/>
<asplaceHolder ID="thePlaceHolder" runat="server"/>
</form>
</body>
The "thePlaceHolder" object is where I put my User object.
I am trying to get to some of the objects inside of this user object and if
I walk the Dom I can see some (but not all the objects).
I can't even seem to get to the "theBox" object which is one of the first
objects in the Dom. I tried to get the object like this:
function entry()
{
alert("On Entry");
var theObject = window.opener.document.getElementById('theBox');
alert("After Entry theObject = " + theObject);
alert("length = " + window.opener.document.addForm.length);
for (var i = 0;i< window.opener.document.addForm.length;i++)
{
alert("inside for loop i = " + i);
var e = window.opener.document.addForm.elements;
alert("e.type = " + e.type);
alert("e.name = " + e.name);
}
}
theObject ends up being null. If I move the "theBox" object outside of the
form, it seems to find it fine.
When I walk the Dom, the length is about 25 and I know there are about 200
objects on the page. Some of the objects are being shown inside of the User
control - but "theBox" doesn't show at all. And it is one of the first
ones.
The trace shows the first part of the objects as:
__PAGE ASP.ResumeSubmittalForm_aspx
_ctl1 System.Web.UI.LiteralControl
_ctl2 System.Web.UI.LiteralControl
MyStyleSheet System.Web.UI.HtmlControls.HtmlGenericControl
_ctl3 System.Web.UI.LiteralControl
myBody System.Web.UI.HtmlControls.HtmlGenericControl
_ctl4 System.Web.UI.LiteralControl
addForm System.Web.UI.HtmlControls.HtmlForm
_ctl5 System.Web.UI.LiteralControl
theBox System.Web.UI.WebControls.Label
_ctl6 System.Web.UI.LiteralControl
thePlaceHolder System.Web.UI.WebControls.PlaceHolder
_ctl0 ASP.mainPage_ascx
_ctl0:_ctl2 System.Web.UI.ResourceBasedLiteralControl
_ctl0:HomeLink System.Web.UI.WebControls.HyperLink
_ctl0:_ctl3 System.Web.UI.LiteralControl
_ctl0:MyInformationLink
System.Web.UI.WebControls.HyperLink
_ctl0:_ctl4 System.Web.UI.LiteralControl
_ctl0:ResumeLink System.Web.UI.WebControls.HyperLink
_ctl0:_ctl5 System.Web.UI.LiteralControl
_ctl0:CoverLetterLink
System.Web.UI.WebControls.HyperLink
_ctl0:_ctl6 System.Web.UI.LiteralControl
_ctl0assportLink System.Web.UI.WebControls.HyperLink
The Forms collection shows as:
__EVENTTARGET _ctl0:_ctl1reviewLink
__EVENTARGUMENT
__VIEWSTATE dDwzNj
_ctl0:_ctl1:resumes 0
ctl0__ctl1_ResumeText
ctl0__ctl1_CoverLetter
_ctl0:_ctl1:GenderList
_ctl0:_ctl1:EthnicityList
_ctl0:_ctl1:VeteranStatus
_sk_scrollkeepervalue 0!0
Where is the "theBox" control and when walking the Dom it show the length as
25.
What is going on?????
Is this a problem with asp.net 1.1????
Thanks,
Tom