Connecting Tech Pros Worldwide Forums | Help | Site Map

ascx questions

Peter Kirk
Guest
 
Posts: n/a
#1: Mar 29 '06
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[color=blue]
>[/color]

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



Ward Bekker
Guest
 
Posts: n/a
#2: Mar 29 '06

re: ascx questions


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.

--
Ward Bekker
"Asp.Net Discussions for the Professional Developer"
http://www.dotnettaxi.com

"Free .Net 2.0 C# to/from VB.Net Code Converter"
http://www.dotnettaxi.com/Tools/Converter.aspx
Peter Kirk
Guest
 
Posts: n/a
#3: Mar 29 '06

re: ascx questions



"Ward Bekker" <ward@NospaaMequanimity.nl> skrev i en meddelelse
news:e0dihd$14t$3@news.cistron.nl...[color=blue]
> 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.[/color]

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


Closed Thread