November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
You are calling the Page_Load handler. You probably want to call the method.
It should be:
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
You should know the difference between the event and the method I think. Read this:
http://odetocode.com/Blogs/scott/archive/2005/10/06/page_load-versus-onload.aspx
and this
http://support.microsoft.com/kb/814745
Also when using the method override everywhere in your code you can set AutoEventWireup="false" in your templates.
Thanks Andreas,
I saw that I was calling the method not the handler in my example, that was my first mistake!
I did however have other templates that were overloading the correct function, and again you are right, it seems I had overlooked the AutoEventWireUp tag in the pages Control tag. This was a complete oversight on my part! It seems when you create an EPiServer Web User Control using the VS Tempaltes it adds AutoEventWireUp="true" as default and I completely missed this.
Thanks for the answer though, most helpful. I have to admin that due to urgencies in project timelines and such I've had to 'dust off' my .NET boots and hit the ground running. And now I do feel kind of rusty!
For this evening I'm going to re-read the links you kindly supply, and further my understanding of the AUtoEventWireUp tag :)
Thanks again.
Hi,
I am creatign a site, using AlloyTech as an example and guide. I note that the first call in the constructor of every WebUserControl is
however, whenever I add this simple code line, so as to properly construct my controls, It throws a 'System.StackOverflowException' exception.
StackOverflowException was unhandled
An unhandled exception of type 'System.StackOverflowException' occurred in System.dll
I am a little bit green with EPiServer so I'm not ruling out that I've missed something simple, or that there is a recursion that I'm just not seeing. However the error message gives little clue!
Take my simple PageHeader.ascx for example, pretty much as simple as they come, heres the ascx file
And heres the codebehind :
I really don't see anything obvious. Can anyone advise?