Telerik's ASP.NET Modal Dialog component offers two modes for loading the content inside -
ContentTemplate and
NavigateUrl. When the ContentTemplate is used the RadWindow acts as an INaming container on the page and the controls inside are still a part of the page. When the NavigateUrl is set the RadWindow loads the external page in an iframe, which creates a separate document. Each of these modes has its benefits and drawbacks:
Pros for using the ContentTemplate:
- You can easily access controls from the main page from within the RadWindow and vice-versa via JavaScript
- The controls inside the ContentTemplate are actualy a part of the main page
- This provides easy access in the code behind as well, which is impossible with iframes
- It is suitable for a simple user input or form
Cons for using the ContentTemplate:
- You have to be careful in AJAX scenarios so that you do not get nested update panels, as the RadWindow is an INaming container only
- If a large number of controls are loaded inside this will increase the initial page load, as they all have to be loaded
Pros for using the NavigateUrl
- This provides a separate document in the RadWindow
- It is suitable for showing more information on the given subject or displayng a complex form / web page, as the content is loaded only when the RadWindow is shown
- You can also use AJAX and update panels within the page as it is a separate document
Cons for using the NavigateUrl
- Communication between the page loaded within the RadWindow and the main page is more difficult as the content in the RadWindow is an iframe
- You may not always be able to gain access due to the JavaScript cross-site policy
- Access through the code-behind is more difficult even for pages in the same application and impossible for external sites