Troy Mitchel
Troy Mitchel

Reputation: 1810

How to load a web page into another web page

I want to be able to load a webpage (with many asp:controls) into a panel of my main web application. Basically from a user menu, the corresponding webpage will be loaded. So far I've tried the following...

  1. IFrame - this doesn't keep the view states of the controls
  2. Creating dynamic controls as opposed to web pages, but very slow with alot of controls because you have to re-create every control on a postback.

Is there a reasonable way to accomplish this?

Upvotes: 0

Views: 673

Answers (1)

Ken Henderson
Ken Henderson

Reputation: 2828

I'm assuming you're working with ASP.NET web forms based upon the control specifics in your question.

From what you've described it sounds like you want to add a UpdatePanel control to your current page. The update panel could host your custom UserControl, this would most likely help with page responsiveness (generally this is what the TreeView control does).

That being said unless the data source for your dynamic controls is slow (or the web server is overloaded) a hundred dynamic controls shouldn't kill your page render times. I've written pages that use in excess of 100 dynamic controls against a SharePoint instance and it was reasonably responsive. Keep in mind that all server side controls are class instances that are created, loaded, rendered (skipped a bunch of lifecycle events but you get the idea).

Upvotes: 1

Related Questions