ascx questions

P

Peter Kirk

Hi

I have an ascx (MainCalendarControl.ascx), which includes another ascx, by
using this statement at the top of MainCalendarControl.ascx:

Register TagPrefix="CalendarUI" TagName="ActivityListControl"
Src="ActivityCalendar.ActivityListControl.ascx"

Then there are various tables etc in MainCalendarControl.ascx to display
some data, and last:

<
CALENDARUI:ACTIVITYLISTCONTROL id="activityList"
runat="server"></CALENDARUI:ACTIVITYLISTCONTROL
What order should the page display be generated? It appears the Page_Load
method in the included ActivityListControl.ascx is called before the
Page_Load in the containing MainCalendarControl.ascx - is this correct?

And it also appears that the Page_Load method in ActivityListControl.ascx is
called twice - why would this be?
That is, the order of calls to Page_Load is:

ActivityListControl.ascx Page_Load
MainCalendarControl.ascx Page_Load
ActivityListControl.ascx Page_Load


Thanks for any comments,
Peter
 
P

Peter Kirk

Ward Bekker said:
Hi Peter,

It's correct that first the child must be loaded (Page_Load) before the
parent can be loaded.

I would not expect the Page_Load to fire twice for the same control, but
from what I have read, i cannot give you a solution.

Hi, thanks for your answer. I found out that the reason the Page_Load was
being fired twice was because the two ascx's are running in a CMS, which
controls what is showed where - and the CMS was generating a view which
included both the main and child ascx's, at the same time as the main ascx
was including the child ascx.

Peter
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top