ASP.NET Window - How to control Window from the webpage loaded by Window?

Problem: As we know, when Window loads a page using Url="[link]" or setUrl("[link]"). The loaded page is seperated from main page which contain client-side Window object. How can we make this page able to control Window component at clientside?

Solution: Using javascript to attach Window object to global element.

*Note: This method can only be used when main page and page loaded inside Window are in the same domain. Different domain will cause well-known security issues "Cross-site scripting".

* Click "Open" to open Window


 



ASP.NET
          <owd:Window ... ID="myWindow" Url="innerPage.aspx" OnClientInit="window.myWindow = myWindow;" ... >
          </owd:Window>    
    
Java Script
window.parent.myWindow.Close();

"It is amazing how you guys have the tools that suits our needs to the "T" and I'm really glad to see that these tools are compatible with 3.5 as we would be moving there shortly."

Ramarao Prahalad
Texas Association of School Boards

Random testimonial   All testimonials