Adding dynamic objects to a page

melkanzi

Freshman
Joined
Jul 9, 2006
Messages
29
Hello,

Im working on a site that requires me to divide the page(Main events page) into 3 parts. One part being a calender, a part to login and a part to show the events on the date selected.
The login and calender are done. The user wants the events part to be displayed in a frame, just like this box im typing in with a scoller. I've put an IFrame object but what I cant do is add the events objects(usercontrols) to the page that the IFrame will display(events page) a different page from the Main events page.
I want to be able to add the usercontrols into the events page dynamically so that the IFrame will show the events page.
How can this be done??

Thanks alot.
 
what I cant do is add the events objects(usercontrols) to the page that the IFrame will display(events page) a different page from the Main events page.
I want to be able to add the usercontrols into the events page dynamically so that the IFrame will show the events page.

not sure i understand this right... is this correct:
you have a form that you have divided into three sections (Main Form)
you want to add controls to the Main Form to control the IFrame
in the IFrame you're wanting to list the events, guessing manipulated by the controls on the main form?

can you provide a code sample of what you're trying, and maybe a screenshot?
 
You are trying to add a separate page inside the iFrame?

<iframe id="FrameID" src="YOUREVENTSPAGE>aspx" frameborder="0" width="100%" height="100%" runat="server"></iframe>

should do the trick, just make sure the path is correct and set the Scrolling property to "auto" so you can have scrollbars.
 
Last edited:
alreadyused, the usercontrols are created when the user clicks on a date on the calender on the Main form. I want to add these usercontrols onto the eventspage which will be displayed on the IFrame.

Eduardo Lorenzo I know how to set the properties of the IFrame what I want is to add the usercontrols created on the main form onto the page that the IFrame will display
 
Pass querystring parameter

The way I would approach this would be to have the framed page add the usercontrols itself, based on a querystring parameter which is set by the parent page.

For example, in the parent page:

Visual Basic:
myFrame.Attributes("src") = "ShowEvents.aspx?date=" + dateToDisplay.ToString()

And in the framed page:

Visual Basic:
Dim showDate As DateTime

showDate = DateTime.Parse(Request.QueryString("date"))

'Add controls to page based on showDate

Here the framed page can manage its own controls based on a parameter from the parent page.

Good luck :cool:
 
Back
Top