473,804 Members | 3,225 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OnInit method of a System.Web.UI.P age Class

Hi,

I have a newbie question, every time I add a web page into a web application
using VS.Net there is a method automatically generated by VS.Net:

override protected void OnInit(EventArg s e)
{
InitializeCompo nent();
base.OnInit(e);
}

I look into Page class more than 10 times already, there is no OnInit method
defined.

Question:
(1) If base class has no such method defined, what will base.OnInit(e) do?

TIA
Nov 18 '05 #1
3 2042
the Page class inherits the OnInit

-- bruce (sqlwork.com)
"Raymond Du" <rd**@yahoo.com > wrote in message
news:e5******** ******@tk2msftn gp13.phx.gbl...
Hi,

I have a newbie question, every time I add a web page into a web application using VS.Net there is a method automatically generated by VS.Net:

override protected void OnInit(EventArg s e)
{
InitializeCompo nent();
base.OnInit(e);
}

I look into Page class more than 10 times already, there is no OnInit method defined.

Question:
(1) If base class has no such method defined, what will base.OnInit(e) do?
TIA

Nov 18 '05 #2
Could you elaborate? Inherits from which class?

Thanks Again.

"bruce barker" <no***********@ safeco.com> wrote in message
news:OZ******** *****@TK2MSFTNG P09.phx.gbl...
the Page class inherits the OnInit

-- bruce (sqlwork.com)
"Raymond Du" <rd**@yahoo.com > wrote in message
news:e5******** ******@tk2msftn gp13.phx.gbl...
Hi,

I have a newbie question, every time I add a web page into a web

application
using VS.Net there is a method automatically generated by VS.Net:

override protected void OnInit(EventArg s e)
{
InitializeCompo nent();
base.OnInit(e);
}

I look into Page class more than 10 times already, there is no OnInit

method
defined.

Question:
(1) If base class has no such method defined, what will base.OnInit(e)

do?

TIA


Nov 18 '05 #3
Never mind. I found the answer: System.UI.Web.C ontrol.
"Raymond Du" <rd**@yahoo.com > wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Could you elaborate? Inherits from which class?

Thanks Again.

"bruce barker" <no***********@ safeco.com> wrote in message
news:OZ******** *****@TK2MSFTNG P09.phx.gbl...
the Page class inherits the OnInit

-- bruce (sqlwork.com)
"Raymond Du" <rd**@yahoo.com > wrote in message
news:e5******** ******@tk2msftn gp13.phx.gbl...
Hi,

I have a newbie question, every time I add a web page into a web

application
using VS.Net there is a method automatically generated by VS.Net:

override protected void OnInit(EventArg s e)
{
InitializeCompo nent();
base.OnInit(e);
}

I look into Page class more than 10 times already, there is no OnInit

method
defined.

Question:
(1) If base class has no such method defined, what will
base.OnInit(e) do?

TIA



Nov 18 '05 #4

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

Similar topics

2
5579
by: | last post by:
Sorry, I mixed up the code- reposting with correct example now :) I'm trying to better understand the use of inheritance vs. the implementation of a handler. I wanted to ask this question to the newsgroup. Each aspx page is a class which Inherits System.Web.UI.Page. Then, each page has it's own implementation of Private Sub Page_Load and Private Sub Page_Init to handle the Handles MyBase.Load and Handles MyBase.Init events...
3
5036
by: Stuart McGraw | last post by:
I have a wxPython app, conventionally structured with a Application class derived from wx.App. My problem is that the app accepts a command line argument that must be acted upon within the OnInit() method of the Application class. How do I pass it cleanly from main() into app.OnInit()? In the simplified example below, dbfn is the piece of info that is in main() that OnInit() needs to use. Is a global variable is the only way? :-(
1
2246
by: | last post by:
Hi, All, I'm having problems getting OnInit to fire in my UserControl, when I use a custom template to render the control. The control will render to the browser and it wasn't until I needed to perform some initialization in the OnInit event did I realize that this event was never firing. Two Question:
8
4282
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue which is related to the repeater. In the code shown below, if I call Repeater1.Controls.Count in the OnInit (the code fragment was highlighted in yellow) , the viewstate for the repeater will be lost during the postback. You can re-produce this...
2
5313
by: Brandon Potter | last post by:
Why is it that when I override the OnInit method for a page, I can add a user control like this: Me.Controls.Add(LoadControl("MyControl.ascx")) (where MyControl.ascx is your every day user control) .... but when I use: Dim mC As New MyControl
1
1117
by: tatemononai | last post by:
I've got a asp.net page that is derived off a custom class. The base class does some init stuff in OnInit that is needed by the derived pages. I'm having a timing problem with OnInit. The OnInit in the derived classes executes BEFORE the OnInit in the base class. I need it to be the other way around. How can I fix this?
1
3274
by: harry potter | last post by:
Hi, Are there any reasons to use OnInit or Page_Init method to invoke some code when the Init event is triggered, if at all. Or are they both just the same? -S.
0
1411
by: multiformity | last post by:
Ok, so I have gone off and documented the lifecycle of a page with a custom composite control on it. You can find that document here: http://www.ats-engineers.com/lifecycle.htm Now, I am working on a much more complex grid example, and according to my findings, the order should be like so: Page Constructor Page OnInit
3
3013
by: Beavis | last post by:
I hate to repost a message, but I am still at the same point where I was when I originally posted, and hopefully someone else will see this one... Ok, so I have gone off and documented the lifecycle of a page with a custom composite control on it. You can find that document here: http://www.ats-engineers.com/lifecycle.htm
0
9588
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10589
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.