Displaying a aspx page within a page

B

BoltonWolf

Hi,

I was wondering if someone could give me a bit of advice on achiving
something.

I have a page with a panel on it. Is it possible to then load content
into the panel from a second aspx page.

The web site I am writing is a reporting tool for a database, and I
don't want to write a completely new web page for each report I
create. It would be better for me to be able to create a sub page for
each report and display it on the main page in side a container, e.g.
a panel.

I know i can achieve this using frames, but don't want to go down that
route.

Many thanks in advance

Chris
(e-mail address removed)
 
M

MattC

How about swithing your idea around. Place the common code in a user
control and insert that into each report page.

MattC
 
E

Eliyahu Goldin

Chris,

Are you familiar with iframes? Do you include iframes in the "frames" you
don't want to use? Your case is exactly what iframes are good for.

Eliyahu
 
G

GMK

Well I would here like to ask is it possible to access the values of a
control inside a user control from a webcontrol outside it??
In other words, if i have a dropdownlist that contains data from a database
and this dropdown list is a user control where the query that fill is it is
emmbeded with it as user control, can i use the data inside using an event
lunched from outside the control? the event maybe lunched by a button on the
page
thank you for your help
 
B

BoltonWolf

Eliyahu,

Thanks for that I had not heard of IFrames before, but have just
looked them up and they are exactly what I need.

One question though, in my HTML book it says that they are only
compatable with IE, however my book is a few years old. Is this still
the case?

In my situation this isn't a major problem as the web site is not in
the public domain, but I would like to know for future reference.

Thanks again

Chris
 
E

Eliyahu Goldin

Chris,

My personal experience is limited to IE only, but as far as I know all
browsers now should support them.

Eliyahu
 
M

MattC

Sure,

If you expose the controls in a property you can get at the data directly.

Dont forget to wire up the user control instance to your page variable in
OnInit.

e.g.

class myPage : System.Web.UI.Page
{
protected MyControl _myusercontrol;

override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
_myusercontrol= (MyControl )ReportCriteria.FindControl("_myusercontrol");
}
}
 
K

kit

try to write your 2nd (& many others) pages into .ascx, then load them
into the panel. they are user control, and have most of the
functionalities of .aspx

kit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top