I have a timer on my parent master page that checks for certain events and updates controls that I want through an updatePanel.
I have numerous child pages that inherit from the master page.
I get the desired effect of the timer checking for some event and updating the controls I specified.
The undesired effect is the timer will go through the selected(In View) child page --- page life cycle.
So if I have a code in my
Page_Init or
Page_Load event handlers whatever is in them gets executed.
Doesn't render the html because it is a call back and only updates the control I specified like I wanted but, It seems unnessary that It goes through the page lifecycle of the child page.
I do logging in the methods I have in some of these page life cycle stages and If I happen to leave my user agent with a view of one of this pages, it will be logging every interval that the timer is set to. That is not desired.
Here is a pseudo example
Master Page aspx = Timer set to interval 30 sec , And Update panel with updatemode set to conditional
Master code behind = Page_load checkforEvent and if true update the panel.
******************************************************************************************************
Child page 1 inherits from Master page
Page load = Do something specific to the page and nothing to do with timer , by the way log what you do
**************************************************
Child Page 2 inherits from Master page
Page load = Do something specific to the page and nothing to do with timer,by the way log what you do
********************************
My expected result is ,
Go through page load and other page life cycles of the of the master page but not the children.
Apparently that is not the case.
Question is, How Can I stop the timer from firing my child page event handlers??
The sender in the page load of the child says it is the child page not the timer, so I cant say if timer skip what it usually does.
I also can't set a flag in the master page , like a session var to flag the timer because in ASP.net the child fires before the Master.
What to do,what to do?
Thanx!