473,407 Members | 2,314 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,407 software developers and data experts.

Web Form Designer generated code

Dear colleagues,
Does anyone have an idea where I could find precise and detailed
explanation of each and every statement of the following “Web Form Designer
generated code”:
#region Web Form Designer generated code
override protected void OnInit(aS.EventArgs e) {
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>

private void InitializeComponent() {
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
I’ve my good reasons to ask for this grass-root “precise and detailed
explanation”, that I’ll be glad to expose, were anybody interested to.

Thanks for your attention.
P.M.
Nov 16 '05 #1
7 2766
You can find answers to any of your questions here:
www.msdn.com
"Studio P.M." <St******@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
Dear colleagues,
Does anyone have an idea where I could find precise and detailed
explanation of each and every statement of the following "Web Form Designer generated code":
#region Web Form Designer generated code
override protected void OnInit(aS.EventArgs e) {
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>

private void InitializeComponent() {
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
I've my good reasons to ask for this grass-root "precise and detailed
explanation", that I'll be glad to expose, were anybody interested to.

Thanks for your attention.
P.M.

Nov 16 '05 #2
The first section is an override of the Page.OnInit method. It is overriden
to implement the call to InitializeComponent, where the event handlers and
other initialization steps are created. The base.OnInit(e) call is required
because you generally want to call the base method of any overridden method.

The last main component is the line that starts with this.Load +=. This
line registers an event handler for the Page.Load event. By default, the
IDE calls the event handler method Page_Load.

This is pretty basic functionality of VS2003 and ASP.Net. If you need more
you could just go to MSDN as another resonder suggests but you'd be better
off starting with something introductory such as Microsoft Press'
Step-By-Step series titles on ASP.Net and C#.

HTH

DalePres
MCAD, MCDBA, MDSE

"Studio P.M." <St******@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
Dear colleagues,
Does anyone have an idea where I could find precise and detailed
explanation of each and every statement of the following "Web Form
Designer
generated code":
#region Web Form Designer generated code
override protected void OnInit(aS.EventArgs e) {
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>

private void InitializeComponent() {
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
I've my good reasons to ask for this grass-root "precise and detailed
explanation", that I'll be glad to expose, were anybody interested to.

Thanks for your attention.
P.M.

Nov 16 '05 #3
I’m delighted by your courtesy, and competence. Heartily thanks.

Reason for this question is that I cannot anymore accept passively such
automatically generated code because of the fact that, in some circumstances
(that I can reproduce at will), my code is victim of a Page_Load multiple
“firing”. In other words the Page_Load event handler inexplicably enters more
than once and, at the second entry, Login credentials are asked again
interactively.
Were anybody interested in this “incident” I’ll be more than pleased to let
know and discuss it.

Thanks again for your support.
Pietro
- - - - -=- - - - -=- - - - -=- - - - -=- - - - -=- - - - -=- - - - -=

"DalePres" wrote:
The first section is an override of the Page.OnInit method. It is overriden
to implement the call to InitializeComponent, where the event handlers and
other initialization steps are created. The base.OnInit(e) call is required
because you generally want to call the base method of any overridden method.

The last main component is the line that starts with this.Load +=. This
line registers an event handler for the Page.Load event. By default, the
IDE calls the event handler method Page_Load.

This is pretty basic functionality of VS2003 and ASP.Net. If you need more
you could just go to MSDN as another resonder suggests but you'd be better
off starting with something introductory such as Microsoft Press'
Step-By-Step series titles on ASP.Net and C#.

HTH

DalePres
MCAD, MCDBA, MDSE

"Studio P.M." <St******@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
Dear colleagues,
Does anyone have an idea where I could find precise and detailed
explanation of each and every statement of the following "Web Form
Designer
generated code":
#region Web Form Designer generated code
override protected void OnInit(aS.EventArgs e) {
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>

private void InitializeComponent() {
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
I've my good reasons to ask for this grass-root "precise and detailed
explanation", that I'll be glad to expose, were anybody interested to.

Thanks for your attention.
P.M.


Nov 16 '05 #4
In the Page directive at the top of your ASPX file, look for the
AutoEventWireup attribute and make sure it is set to false. Alternatively,
you can eliminate that code and use the AutoEventWireup capabilities.

A lot of developers don't use either of those models and manually create all
their code but then some developers still develop in Notepad, as well. My
preference is the first choice, set AutoEventWireup to false, let the tools
do the grunt work, and you do the fun stuff.

Here's an article that might help:

http://msdn.microsoft.com/library/de...eventmodel.asp

HTH

DalePres
MCAD, MCDBA, MCSE

"Studio P.M." <St******@discussions.microsoft.com> wrote in message
news:FA**********************************@microsof t.com...
I'm delighted by your courtesy, and competence. Heartily thanks.

Reason for this question is that I cannot anymore accept passively such
automatically generated code because of the fact that, in some
circumstances
(that I can reproduce at will), my code is victim of a Page_Load multiple
"firing". In other words the Page_Load event handler inexplicably enters
more
than once and, at the second entry, Login credentials are asked again
interactively.
Were anybody interested in this "incident" I'll be more than pleased to
let
know and discuss it.

Thanks again for your support.
Pietro

Nov 16 '05 #5
> AutoEventWireup attribute and make sure it is set to false.
Sure:
<%@ Page language="C#" AutoEventWireup="false" ...
http://msdn.microsoft.com/library/de...eventmodel.asp This is the article I've read BEFORE asking here for help.

See you.
Pietro
- - - - -=- - - - -=- - - - -=- - - - -=- - - - -=- - - - -=

"DalePres" wrote:
In the Page directive at the top of your ASPX file, look for the
AutoEventWireup attribute and make sure it is set to false. Alternatively,
you can eliminate that code and use the AutoEventWireup capabilities.

A lot of developers don't use either of those models and manually create all
their code but then some developers still develop in Notepad, as well. My
preference is the first choice, set AutoEventWireup to false, let the tools
do the grunt work, and you do the fun stuff.

Here's an article that might help:

http://msdn.microsoft.com/library/de...eventmodel.asp

HTH

DalePres
MCAD, MCDBA, MCSE

Nov 16 '05 #6
Dear Mr. HTH – DalePres,
Could we keep discussing this topic? Indeed, in my opinion, it is yet
far from clear and under (my) control.
Please consider the following points.

1) Here we are not exactly in presence of a “Server Control” event, are we?
And the reference “ASP.NET Server Control Event Model” doesn’t exactly apply,
does it?

2) By definition “events associated with server controls are raised on the
client but handled on the Web server by the ASP.NET page framework”. But here
we are BEFORE the posting of an .aspx page to a client computer. Or, better,
this is (I presume) exactly that very event.

3) I haven’t found any documentation about Page.OnInit, only about
Control.OnInit; and I’m not sure it is the same thing. Is it?

4) Problem is that sometimes (that I can reproduce) the event Page_Load is
triggered (“fires”) more than once, and this is disruptive for my current
project.

As you see I’m really confused (and baffled too…). Could we keep discussing
this topic?
Thanks for your time.
P.M.
"Studio P.M." wrote:
Dear colleagues,
Does anyone have an idea where I could find precise and detailed
explanation of each and every statement of the following “Web Form Designer
generated code”:
#region Web Form Designer generated code
override protected void OnInit(aS.EventArgs e) {
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>

private void InitializeComponent() {
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
I’ve my good reasons to ask for this grass-root “precise and detailed
explanation”, that I’ll be glad to expose, were anybody interested to.

Thanks for your attention.
P.M.

Nov 16 '05 #7
Hello,

I had the same problem -- rename your Login.aspx page to something else and
it will work fine.

"Studio P.M." wrote:
Dear colleagues,
Does anyone have an idea where I could find precise and detailed
explanation of each and every statement of the following “Web Form Designer
generated code”:
#region Web Form Designer generated code
override protected void OnInit(aS.EventArgs e) {
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>

private void InitializeComponent() {
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
I’ve my good reasons to ask for this grass-root “precise and detailed
explanation”, that I’ll be glad to expose, were anybody interested to.

Thanks for your attention.
P.M.

Mar 15 '06 #8

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

Similar topics

0
by: sshuangw | last post by:
Hello: I am encountering a very weird issue with MDI child, Overriden WndProc function and hidden form. Basically, the application has two forms, Form1(parent form), Form2(Child form),...
3
by: Chris | last post by:
Hi, I'm trying to append text from another class to a generic richTextBox that I've added to a Windows form. I can't seem to figure out how to expose the richTextBox to append text to it. ...
2
by: Jaikumar | last post by:
Hi, 1) I have created one windows application, In the main form ( form1) i have added one usercontrol (usercontrol1), In that user control i am drawing one image. 2) In the UserControl1 i am...
2
by: baret bonden | last post by:
Trying to return a selected listbox item to another form .tried lots of ways; defining public variables and passing those as well as textboxes ..I' m able to display the chosen item on it's form...
18
by: Jan Nielsen | last post by:
Hi I have a main form showing personal information (name, address etc.) bound to a dataset. One of the pieces of information is the Group the person belongs to. This is selected from a combo box....
0
by: Amiram Korach | last post by:
When you create a MDI form, you can attach a main menu to the parent and to the child. When a child form is active, its menu is merged with the parent menu. The problem is: when the forms are...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
7
by: Terry | last post by:
I have a Mainform with a Statusbar. When opening another form or doing some processing I want to display info in the Statusbar of the Mainform. I have read a lot of articles on this & have come up...
13
by: cj | last post by:
In a project done in 2003 about a year ago I was told to add the SocketWrench code below into the Windows Form Designer generated code area as shown below. #Region " Windows Form Designer...
8
by: TomC | last post by:
I want to bypass the Windows Form Designer in VS, to create a form programmatically. The elements of the form are to be arranged in a table, and I want the size of the table (and therefore the...
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: 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
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
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
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
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...
0
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 projectplanning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.