473,408 Members | 1,730 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,408 software developers and data experts.

Where is Init() & InitializeComponent()?

When I add a new aspx page to my project, I don't see Init() or
InitializeComponent() in any of the page's CS files. Where are the
methods stored?

Thanks.

Feb 6 '07 #1
4 9896
They are contained in a #region in your form's code behind .cs file annotated
"Web Form Designer generated code" which by default is minimized in Visual
Studio. Just click the plus sign to the left of "Web Form Designer generated
code" to expand the region and see the code.
--
Jim Anderson, MCSD
Consultant
Columbus, Ohio
"john_c" wrote:
When I add a new aspx page to my project, I don't see Init() or
InitializeComponent() in any of the page's CS files. Where are the
methods stored?

Thanks.

Feb 6 '07 #2
these are no longer required in asp.net 2.0.

-- bruce (sqlwork.com)

john_c wrote:
When I add a new aspx page to my project, I don't see Init() or
InitializeComponent() in any of the page's CS files. Where are the
methods stored?

Thanks.
Feb 6 '07 #3
John and Jim,

MST changed default designing/compilation model in ASP.NET 2.0. By default
AutoEventWireup is set to true, which instructs compiler to automatically
attach event handlers from the code behind/beside file using naming
convention (for the page events) i.e.
protected void Page_Load(...)
{
}
is automatically attached behind the scenes:
this.Load += new EventHandler(this.Page_Load)

or controls declarative properties:

<asp:GridView runat="server" id="gv" OnRowDataBound="myeventhandlername"/>
is resolved by compiler as:
gv.RowDataBound += new RowDataBoundEventHandler(this.myeventhandlername);

Hope this helps
--
Milosz
"Jim Anderson" wrote:
They are contained in a #region in your form's code behind .cs file annotated
"Web Form Designer generated code" which by default is minimized in Visual
Studio. Just click the plus sign to the left of "Web Form Designer generated
code" to expand the region and see the code.
--
Jim Anderson, MCSD
Consultant
Columbus, Ohio
"john_c" wrote:
When I add a new aspx page to my project, I don't see Init() or
InitializeComponent() in any of the page's CS files. Where are the
methods stored?

Thanks.
Feb 6 '07 #4
On Feb 6, 12:56 pm, bruce barker <nos...@nospam.comwrote:
these are no longer required in asp.net 2.0.
I am using asp.net 2.0. If I set AutoEventWireUp=false, do I need to
wireup Init() in the page or control constructor?

if I only have perhaps 3 - 5 events, is it better to keep
AutoEventWireUp=false since I don't need everything else it will be
doing? Is there a demarcation point or something to know when it
should be used? I'm only mentioning it because of performance.

Thanks.

Feb 6 '07 #5

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

Similar topics

5
by: Josema | last post by:
Hi, I would need that when i click the button the code of the Onclick method executes first, and then the onInit Method... Its possible make this? -- Thanks Regards. Josema
2
by: melanieab | last post by:
Hi, Just checking to see if there's anything I can possibly do to allow for the recognition of the Tab key being pressed. On the KeyDown event I've tried: if (e.KeyCode == Keys.Tab), if...
15
by: Geoff Cox | last post by:
Hello, Can I separately declare and initialize a string array? How and where would I do it in the code below? It was created using Visual C++ 2005 Express Beta 2 ... In C# I would have ...
9
by: J.Marsch | last post by:
I must be missing something here: The Init event for controls does not seem to fire. What I did: Drop a textbox on a blank webform, hook the textbox's Init event. Code: this.Textbox1.Value =...
5
by: Bob N | last post by:
I have an ASP.NET web page -- several auto-post back DropDownLists that perform a query against a relatively large database (3 to 4 seconds delay) that repopulate a couple of datagrids, comboboxes...
6
by: Shimon Sim | last post by:
I have Panel control on the page. I am handling Init event for it. It doesn't seem to fire at all. Why? Thank you Shimon.
3
by: Lance | last post by:
I've noticed that controls that are contained in MDI child forms fail to raise MouseLeave events if the MDI child form's MdiParent property is set to Nothing (after it was set to an existing MDI...
3
by: nednieuws | charles | last post by:
I've been asked to send the init-script along with the dump. Where can I find it? -- Regards, Charles.
7
by: Doru Roman | last post by:
Hi, What is the fastest way to evaluate manually the result in this case: int a, b, c; a = 255; b = 122; c = a & b; The only way I know is transforming each number into the binary value...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.