473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Inherited page events not being hit

I feel like I'm missing something so simple...

I have a page (start.aspx) whose code behind is
public class Start : AdminPage
{
override protected void OnInit(EventArgs e)
{
base.OnInit(e);
int x=1;
}
}
And my AdminPage class looks like this:
public class AdminPage : System.Web.UI.Page
{
override protected void OnInit(EventArgs e)
{
int x=1;
}
}

No, it's not really this simple, but I'm removing my custom stuff to keep it
simple for this question. Anyway, I build and set a breakpoint in the
AdminPage.OnInit assignment and it never stops... but it does stop on the
Start OnInit if I do the same thing... ideas? I'm flat out lost.

--
-AC [MVP MCMS]
http://www.andrewconnell.com
http://www.andrewconnell.com/mvp

Nov 19 '05 #1
3 1194
Andrew:
If I copy your code exactly into vs.net:

using System;
using System.Web.UI;

namespace TestCS
{
public class Start : AdminPage
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
int x = 1;
}
}

public class AdminPage : Page
{
protected override void OnInit(EventArgs e)
{
int x = 1;
}
}
}

and debug it, I hit both OnInit...your AdminPage should probably also call
base.OnInit(e) but that won't solve your problem......have you tried the
simple example without all the stuff or did you just strip some stuff out
for our benefit?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"AC [MVP MCMS]" <sw*********@gmail.com> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
I feel like I'm missing something so simple...

I have a page (start.aspx) whose code behind is
public class Start : AdminPage
{
override protected void OnInit(EventArgs e)
{
base.OnInit(e);
int x=1;
}
}
And my AdminPage class looks like this:
public class AdminPage : System.Web.UI.Page
{
override protected void OnInit(EventArgs e)
{
int x=1;
}
}

No, it's not really this simple, but I'm removing my custom stuff to keep
it simple for this question. Anyway, I build and set a breakpoint in the
AdminPage.OnInit assignment and it never stops... but it does stop on the
Start OnInit if I do the same thing... ideas? I'm flat out lost.

--
-AC [MVP MCMS]
http://www.andrewconnell.com
http://www.andrewconnell.com/mvp

Nov 19 '05 #2
<ignore my post />

see: stupid overlooked error

--
-AC [MVP MCMS]
http://www.andrewconnell.com
http://www.andrewconnell.com/mvp
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:u6**************@TK2MSFTNGP09.phx.gbl...
Andrew:
If I copy your code exactly into vs.net:

using System;
using System.Web.UI;

namespace TestCS
{
public class Start : AdminPage
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
int x = 1;
}
}

public class AdminPage : Page
{
protected override void OnInit(EventArgs e)
{
int x = 1;
}
}
}

and debug it, I hit both OnInit...your AdminPage should probably also call
base.OnInit(e) but that won't solve your problem......have you tried the
simple example without all the stuff or did you just strip some stuff out
for our benefit?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"AC [MVP MCMS]" <sw*********@gmail.com> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
I feel like I'm missing something so simple...

I have a page (start.aspx) whose code behind is
public class Start : AdminPage
{
override protected void OnInit(EventArgs e)
{
base.OnInit(e);
int x=1;
}
}
And my AdminPage class looks like this:
public class AdminPage : System.Web.UI.Page
{
override protected void OnInit(EventArgs e)
{
int x=1;
}
}

No, it's not really this simple, but I'm removing my custom stuff to keep
it simple for this question. Anyway, I build and set a breakpoint in the
AdminPage.OnInit assignment and it never stops... but it does stop on the
Start OnInit if I do the same thing... ideas? I'm flat out lost.

--
-AC [MVP MCMS]
http://www.andrewconnell.com
http://www.andrewconnell.com/mvp


Nov 19 '05 #3
We should be attending some of the same teched sessions, see you there :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"AC [MVP MCMS]" <sw*********@gmail.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
<ignore my post />

see: stupid overlooked error

--
-AC [MVP MCMS]
http://www.andrewconnell.com
http://www.andrewconnell.com/mvp
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:u6**************@TK2MSFTNGP09.phx.gbl...
Andrew:
If I copy your code exactly into vs.net:

using System;
using System.Web.UI;

namespace TestCS
{
public class Start : AdminPage
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
int x = 1;
}
}

public class AdminPage : Page
{
protected override void OnInit(EventArgs e)
{
int x = 1;
}
}
}

and debug it, I hit both OnInit...your AdminPage should probably also
call base.OnInit(e) but that won't solve your problem......have you tried
the simple example without all the stuff or did you just strip some stuff
out for our benefit?

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"AC [MVP MCMS]" <sw*********@gmail.com> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
I feel like I'm missing something so simple...

I have a page (start.aspx) whose code behind is
public class Start : AdminPage
{
override protected void OnInit(EventArgs e)
{
base.OnInit(e);
int x=1;
}
}
And my AdminPage class looks like this:
public class AdminPage : System.Web.UI.Page
{
override protected void OnInit(EventArgs e)
{
int x=1;
}
}

No, it's not really this simple, but I'm removing my custom stuff to
keep it simple for this question. Anyway, I build and set a breakpoint
in the AdminPage.OnInit assignment and it never stops... but it does
stop on the Start OnInit if I do the same thing... ideas? I'm flat out
lost.

--
-AC [MVP MCMS]
http://www.andrewconnell.com
http://www.andrewconnell.com/mvp



Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert | last post by:
Hi, I've inherited the XmlDocument class to include some custom methods that I want to use on a particular XML file. I need to know whether the document has changed since being loaded, and I...
7
by: Opa | last post by:
Hi, I have a class (ClassB) that inherits from another class (ClassA) which has a delegate and event. I can see the events from ClassA in an intance object I create of ClassB. I also...
4
by: James Hancock | last post by:
I have a page, which is inherited from another page (PageEx is what I call it) All of our pages are based on PageEx because there is a bunch of logic stuff we do in there. My problem is, that if...
1
by: Shaun | last post by:
I am using a base page (I think they're also called master pages) as a base that my webforms inherit from. The base page controls formating and common functions used throughout the site. This all...
10
by: Chad Miller | last post by:
I currently have a base form that I inherit. The base for has a custom event. The event will not raise threw the inherited form. I was wondering if events work threw inheritance or should I use...
1
by: skootr | last post by:
I have a Public Interface defined in a class module. I also have a form that implements that interface After building the solution, I added an Inherited Form (inherited from the above-mentioned...
3
by: Jeff User | last post by:
Hello I am using C#, .net1.1 Vis Studio 2003 I am using homeBase.aspx.cs page as a base for several other aspx/aspx.cs web pages. The base page handles some operations that are common to all...
7
by: c#2006user | last post by:
Hi all i have a c# problem, i have a base class Page and a good few classes inheriting from it. the events and delegates are declared in the base class page but different classes have different...
2
by: MuZZy | last post by:
Hi, Consider i have this code: // --------------------------------------------------------------------- public delegate void DoSearchEventHandler(Form f, DoSearchEventArgs e); public class...
2
by: alexia.bee | last post by:
Hi All, I have window based app which has two classes. Class A and Clas B Call B Inherits from Class A. Class A has events. How do I cause Class B not to use Class A events. For example:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.