Showing posts with label sequence. Show all posts
Showing posts with label sequence. Show all posts

Thursday, March 29, 2012

sequence in which page is loaded

I want to know the sequence of functions that are invoked when a page is loaded like page_init is always invoked before page_load and so on ... i need the exact sequence of all the events of a page that if i put code in each event which is going to work in which sequence.

Regards,

Harris Moinno one has even viewed my post yet ...... :(((((

Anyways i have found the result myself might be helpful for someone out there as well .... so posting it here

SEQUENCE OF THE PAGE EVENTS IN WHICH THEY ARE FIRED

1. Initialize:
==========
Initialize settings needed during the lifetime of the incoming Web
request.

2. Load view state:
================
At the end of this phase, the ViewState property of a control is
automatically populated as described in Maintaining State in a Control.
A control can override the default implementation of the LoadViewState
method to customize state restoration.

3.Process postback data:
======================
Process postback data Process incoming form data and update properties
accordingly.

4. Load:
=======
Perform actions common to all requests, such as setting up a database
query. At this point, server controls in the tree are created
and initialized, the state is restored, and form controls reflect
client-side data.

5. Send postback change notifications:
=================================
Raise change events in response to state changes between the current and
previous postbacks.
Note Only controls that raise postback change events participate in this
phase.

6. Handle postback events:
========================
Handle the client-side event that caused the postback and raise appropriate
events on the server.


7. Prerender:
===========
Perform any updates before the output is rendered. Any changes made to the
state of the control in the prerender phase can
be saved, while changes made in the rendering phase are lost.

8. Save state:
============
The ViewState property of a control is automatically persisted to a string
object after this stage. This string object is sent to the
client and back as a hidden variable. For improving efficiency, a control
can override the SaveViewState method to modify the ViewState
property.

9. Render:
=========
Generate output to be rendered to the client.

10. Dispose:
===========
Perform any final cleanup before the control is torn down.

11. Unload:
==========
Perform any final cleanup before the control is torn down. Control authors
generally perform cleanup in Dispose and do not handle this event.

Sequence of code processing

I am fairly new to ASP.Net and am using VS2005 and .Net 2.0 for page
creation. I am using VB as a language and have VB code between script tags
at the top of my page. I also have a button on my page that runs a
Protected Sub that performs some processing when clicked as noted below:
Protected Sub BtnNewSubfile_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles BtnNewSubfile.Click
...
End Sub
Does this code run before the code at the top of the page or after. Or does
the code at the top of the page run at all when I click the button? Thanks.
DavidDavid,
ASP.Net doesn't run in a linear fashion as classic ASP did. It's
completely event-driven. That means your button click event will be fired at
a particular time based on the design of ASP.Net, not based upon the
location of the code. Paul Wilson has a great article listing all the
various events that will occur on a page and the order in which they occur
at: http://blogs.crsw.com/mark/articles/471.aspx
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199...2006
"David" <dlchase@.lifetimeinc.com> wrote in message
news:%236lzifv8GHA.4996@.TK2MSFTNGP03.phx.gbl...
>I am fairly new to ASP.Net and am using VS2005 and .Net 2.0 for page
>creation. I am using VB as a language and have VB code between script tags
>at the top of my page. I also have a button on my page that runs a
>Protected Sub that performs some processing when clicked as noted below:
> Protected Sub BtnNewSubfile_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles BtnNewSubfile.Click
> ...
> End Sub
>
> Does this code run before the code at the top of the page or after. Or
> does the code at the top of the page run at all when I click the button?
> Thanks.
> David
>
Thank you Mark. I'll check it out.
David
"Mark Fitzpatrick" <markfitz@.fitzme.com> wrote in message
news:%23MkA$hx8GHA.4572@.TK2MSFTNGP02.phx.gbl...
> David,
> ASP.Net doesn't run in a linear fashion as classic ASP did. It's
> completely event-driven. That means your button click event will be fired
> at a particular time based on the design of ASP.Net, not based upon the
> location of the code. Paul Wilson has a great article listing all the
> various events that will occur on a page and the order in which they occur
> at: http://blogs.crsw.com/mark/articles/471.aspx
> --
> Hope this helps,
> Mark Fitzpatrick
> Former Microsoft FrontPage MVP 199...2006
> "David" <dlchase@.lifetimeinc.com> wrote in message
> news:%236lzifv8GHA.4996@.TK2MSFTNGP03.phx.gbl...
>

Sequence of code processing

I am fairly new to ASP.Net and am using VS2005 and .Net 2.0 for page
creation. I am using VB as a language and have VB code between script tags
at the top of my page. I also have a button on my page that runs a
Protected Sub that performs some processing when clicked as noted below:

Protected Sub BtnNewSubfile_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles BtnNewSubfile.Click

...

End Sub

Does this code run before the code at the top of the page or after. Or does
the code at the top of the page run at all when I click the button? Thanks.

DavidDavid,
ASP.Net doesn't run in a linear fashion as classic ASP did. It's
completely event-driven. That means your button click event will be fired at
a particular time based on the design of ASP.Net, not based upon the
location of the code. Paul Wilson has a great article listing all the
various events that will occur on a page and the order in which they occur
at: http://blogs.crsw.com/mark/articles/471.aspx
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"David" <dlchase@.lifetimeinc.comwrote in message
news:%236lzifv8GHA.4996@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>I am fairly new to ASP.Net and am using VS2005 and .Net 2.0 for page
>creation. I am using VB as a language and have VB code between script tags
>at the top of my page. I also have a button on my page that runs a
>Protected Sub that performs some processing when clicked as noted below:
>
Protected Sub BtnNewSubfile_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles BtnNewSubfile.Click
>
...
>
End Sub
>
>
>
Does this code run before the code at the top of the page or after. Or
does the code at the top of the page run at all when I click the button?
Thanks.
>
David
>


Thank you Mark. I'll check it out.

David
"Mark Fitzpatrick" <markfitz@.fitzme.comwrote in message
news:%23MkA$hx8GHA.4572@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

David,
ASP.Net doesn't run in a linear fashion as classic ASP did. It's
completely event-driven. That means your button click event will be fired
at a particular time based on the design of ASP.Net, not based upon the
location of the code. Paul Wilson has a great article listing all the
various events that will occur on a page and the order in which they occur
at: http://blogs.crsw.com/mark/articles/471.aspx
>
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
>
"David" <dlchase@.lifetimeinc.comwrote in message
news:%236lzifv8GHA.4996@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>>I am fairly new to ASP.Net and am using VS2005 and .Net 2.0 for page
>>creation. I am using VB as a language and have VB code between script
>>tags at the top of my page. I also have a button on my page that runs a
>>Protected Sub that performs some processing when clicked as noted below:
>>
>Protected Sub BtnNewSubfile_Click(ByVal sender As Object, ByVal e As
>System.EventArgs) Handles BtnNewSubfile.Click
>>
>...
>>
>End Sub
>>
>>
>>
>Does this code run before the code at the top of the page or after. Or
>does the code at the top of the page run at all when I click the button?
>Thanks.
>>
>David
>>


>
>

Sequence Numbers in c#

Hello sir,

How to provide sequence Numbers for the list of questions

Thanks

Savindra

Whenever asking question, please provide as much info as possible. When do you want to get sequence numbers - in the gridview, webform etc. Provide more info.

Sequence of events

Hi all,

I've got an aspx page with a Web user control and (among other things) a
submit button. When the form is submitted, the same page is to be served
back up, but with some items changed, mainly a panel visible that had not
been and a setting in the user control. The problem I'm having is figuring
out how to manipulate the flagging values as the submit's handler doesn't
fire until the page and controls' load methods. I'm a bit fuzzy on the
firing order of methods between objects, but am I better off moving such
code to the PreRender methods?

TIA,

JohnYour button click event handler should contain the code to flip the
visibility of the panel. The Page_Load code should only contain code that
should execute no matter what.

"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
Yes, moving the code to PreRender is a good idea. It is not always possible,
especially if what has been clicked affects databinding, but, if it is not a
case, go for it. You can't change event sequence.

Eliyahu

"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
Hi John,

I keep the following bookmark handy, when I need to work more closely with
the execution lifecycle:

http://msdn.microsoft.com/library/d...onLifecycle.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
> figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
Thanks, all! One problem down, 3.2 million to go <g>.

"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>

Sequence of events

Hi all,
I've got an aspx page with a Web user control and (among other things) a
submit button. When the form is submitted, the same page is to be served
back up, but with some items changed, mainly a panel visible that had not
been and a setting in the user control. The problem I'm having is figuring
out how to manipulate the flagging values as the submit's handler doesn't
fire until the page and controls' load methods. I'm a bit fuzzy on the
firing order of methods between objects, but am I better off moving such
code to the PreRender methods?
TIA,
JohnYour button click event handler should contain the code to flip the
visibility of the panel. The Page_Load code should only contain code that
should execute no matter what.
"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
>
Yes, moving the code to PreRender is a good idea. It is not always possible,
especially if what has been clicked affects databinding, but, if it is not a
case, go for it. You can't change event sequence.
Eliyahu
"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
>
Hi John,
I keep the following bookmark handy, when I need to work more closely with
the execution lifecycle:
http://msdn.microsoft.com/library/d...onLifecycle.asp
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
> figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
>
Thanks, all! One problem down, 3.2 million to go <g>.
"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
>

Monday, March 26, 2012

sequence of event fires when we run aspx page

Hi,

1. Can any body give me thr detail senario for sequence of events fires for asp.net.

like : Init , page_load , prerender , etc ....

2. Can any body tell me the detail senario for sequence of events fires when we use custom control in aspx page ?

3. Can any body tell me the detail senario for sequence if events fires when we use user control in aspx page ?

I really need some expert's comment here.

Thanks,
-ChintanGoogle is your friend. A simple search for "asp.net page load sequence" returned this:
Read Me

Sequence problem in database

Hi,
I create a database in access. For example, There is a table named 'table1'.
There are 3 field in this table,'projectId','taskId','description';
The data type of taskId is sequence.
When i add any data in this table, i want the value of taskId to be increased according to projectID(also project ID is sequence) Is it possible?If so, how?

Thanks!For example:

projectID TaskID
1 1
1 2
2 1
2 2
2 3
1 3
1 4
3 1
2 4

blah..blah..

Thanks!

Sequence Order between Page Init and User Control Init

Hello everybody,

I got a aspx which have several user controls on it. My question is that
what is the order of ASP.NET execute the page and user control ? does it
like this :

Page Init -> User Control Init -> Page Load -> User Control Load ?

Thx

TonyCheck out ASP.NET 2.0's complete Application Life Cycle:

http://msdn2.microsoft.com/en-us/library/ms178473.aspx

There's very detailed info on ASP.NET's processing order in that document.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Tony Cheng" <sdasd@.fdfsds.com> wrote in message news:OD$P$nQOGHA.2472@.TK2MSFTNGP11.phx.gbl...
> Hello everybody,
> I got a aspx which have several user controls on it. My question is that what is the order of
> ASP.NET execute the page and user control ? does it like this :
> Page Init -> User Control Init -> Page Load -> User Control Load ?
> Thx
> Tony

Sequence Order between Page Init and User Control Init

Hello everybody,
I got a aspx which have several user controls on it. My question is that
what is the order of ASP.NET execute the page and user control ? does it
like this :
Page Init -> User Control Init -> Page Load -> User Control Load ?
Thx
TonyCheck out ASP.NET 2.0's complete Application Life Cycle:
http://msdn2.microsoft.com/en-us/library/ms178473.aspx
There's very detailed info on ASP.NET's processing order in that document.
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Tony Cheng" <sdasd@.fdfsds.com> wrote in message news:OD$P$nQOGHA.2472@.TK2MSFTNGP11.phx.gbl
..
> Hello everybody,
> I got a aspx which have several user controls on it. My question is that w
hat is the order of
> ASP.NET execute the page and user control ? does it like this :
> Page Init -> User Control Init -> Page Load -> User Control Load ?
> Thx
> Tony
>

Sequence of Validator Error Messages

Hi Team,

How I can specify the sequence of validator messages ? I tryed setting
"tabindex" property. but of no use.

Thanks in advance

CheeeeeeeeeeersHi,

You can change the order of the <asp:VALIDATOR> webcontrols in your HTML
file
to the order in which you want the messages displayed.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Thanks Natty Gur... That really works. But I wonder why MS provided
"TABINDEX" !!!!!!

Cheeeeeeeeeeeeeers

"Natty Gur" <natty@.dao2com.com> wrote in message
news:#MJss5X5DHA.1632@.TK2MSFTNGP12.phx.gbl...
> Hi,
> You can change the order of the <asp:VALIDATOR> webcontrols in your HTML
> file
> to the order in which you want the messages displayed.
> Natty Gur[MVP]
> blog : http://weblogs.asp.net/ngur
> Mobile: +972-(0)58-888377
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
It's there due to inheritence from WebControl.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!