Can't get/access elements until inspecting in browser (Old/legacy ASPX)?

40 Views Asked by At

A lot of the webiste has been migrated and is now contained/built in ASP.NET Framework v4.6.X, but there are still some legacy parts that are built in ASPX v3.X, so think about these old projects are rendered in a sub-frame (main screen frame is ASP.NET v4.6 and some ASPX V3.X solutions are redered in a sub-square of the screen). The problem is basically that in this legacy ASPX project/solution elements can't be accessed from web browser's console until I inspect any part of the sub-framed rendered document. So when the page loads initially elements can't be accessed, if I inspect any part of the main frame (ASP.NET v4.6.X) elements still won't be available, only if I inspect any element of the sub-framed part (which renders from ASPX 3.X ) then the elements will be accessible.

The following is an example of how the behavior, tested in Firefox, Edge and Chrome

// initial page load
document.forms
--> HTMLCollection { length: 0 }

// after inspected any part of main frame
document.forms
--> HTMLCollection { length: 0 }

// after inspected any part of the aspx sub-frame
--> HTMLCollection { 0: form#Form1, length: 1, … }

Also I have tried added the following tags in Web.config file (neither of them worked):

<xhtmlConformance mode="Legacy" />
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
...
</pages>

Thanks!

0

There are 0 best solutions below