Questions tagged [page-lifecycle]

When a page is requested on the web the server goes through a number of stages before sending back a response. Thus, the page life cycle is runs between request to response on the server.

Main steps in lifecycle are:

  1. Page request
  2. Start
  3. Initialization
  4. Load
  5. Postback event handling (if it is a postback request)
  6. Rendering
  7. Unload

More information: http://msdn.microsoft.com/en-us/library/ms178472.aspx

471 questions
4
votes
3 answers

Multiple controls with the same ID 'add0' were found. FindControl requires that controls have unique IDs

Previously Called: How to deal with dynamically created controls under load in aspx in response to a question below: the information required to determine which controls to restore is contained in a dedicated viewstate object. I am dynamically…
dice
  • 2,820
  • 1
  • 23
  • 34
4
votes
3 answers

How can page events be handled from a usercontrol? (VB.net)

I would like some code to execute at the "preload" stage of my usercontrol's lifecycle. However the preload event is only available on the Page object. So, I added the following method to my usercontrol: Private Sub Page_PreLoad(ByVal sender As…
James
4
votes
1 answer

How do I implement a method to get and return the LifeCycle

I have issue with the FragmentStateAdapter asking for LifeCycle, kindly help how I can set and pass the LifeCycle in the line of code below. viewPager2.adapter = myViewPagerAdapter(supportFragmentManager, getCurrentLifeCycle()) Here is the…
4
votes
3 answers

When is Control.UniqueId created?

Does anybody know when a control's UniqueId is assigned? Right now I've got some code in my Page_Init that is based off the UniqueId. However, depending on some business logic, I might need to rearrange the control hierarchy of the page before this…
Jim B
  • 8,344
  • 10
  • 49
  • 77
4
votes
2 answers

Xamarin.forms event on leaving/changing the page

I'm looking for something like a function protected override void OnDisappearing() { } in Xamarin Forms. The problem is that this feature is called even when I turn off the phone display. I'm looking for a feature that only responds to the event…
Honza Hála
  • 87
  • 1
  • 9
4
votes
2 answers

What is the advantage of using HttpContext over HttpApplication?

What is the advantage of intercepting a request for an ASP.Net application at the HttpContext level rather than waiting for the request to be processed by the HttpApplication pipeline?
Chris
  • 6,272
  • 9
  • 35
  • 57
4
votes
7 answers

In ASP.Net, How do I run code after sending page

In ASP.Net, I want to run some code (logging, other cleanup) after the page has already been sent to the user. I don't want this code to interfere with the amount of time it takes the client to receive a response. I tried placing this code in the…
Kibbee
  • 65,369
  • 27
  • 142
  • 182
4
votes
4 answers

Get state of ASP.NET page life cycle

I need the following functionality in my method: if the method is called before OnLoad event of ASP.NET life cycle throw an exception else continue execution of the method. I was thinking of something like this: if (Page.LifeCycleState <…
Petr Kozelek
  • 1,126
  • 8
  • 14
4
votes
3 answers

ASP.NET/JavaScript - Script Registration/Redirection Problem

My page has a submit button on it (server-side button). Here's my code for the click event: protected void SubmitButton_Click(object sender, EventArgs e) { db.SaveSomething(); …
RPM1984
  • 72,246
  • 58
  • 225
  • 350
4
votes
2 answers

Viewstate vs Postback

I sort of answered my own question I think but I want to make sure I am understanding correctly. I initially thought that when a user provided values in a form, that on postback the values were submitted as part of the Viewstate, because…
AaronLS
  • 37,329
  • 20
  • 143
  • 202
4
votes
1 answer

Under ASP.Net MVC v1, is Page_Load called?

Stupid Monday morning basic/noob question... Is Page_Load generally called for an ASP.Net MVC app? We just have one page, Default.aspx.cs - which only seems to be called for / and not for any sub-paths, so I dont think it is generally…
Chris Kimpton
  • 5,546
  • 6
  • 45
  • 72
4
votes
1 answer

What happens in a simple Django Rest Framework application that has an Angular front end?

I've been learning Django for some time now, and I found this image helpful: I'm now delving into Angular JS, and I'm trying to figure out how each of the components (Directives, Controllers and Services ?) interacts and if there is a similar…
4
votes
1 answer

ASP.NET MVC ,Maintaining Model State between Ajax requests

problem: On first full page request, my controller invokes an applicationServices Layer (Web Service Proxy to my business tier) in order to populate a collection of current services that is stored in my own controller base class property. This is…
Podders
  • 41
  • 2
4
votes
2 answers

Dynamic Event Handler not Firing

I want to create an amount of controls dynamically based on a number the user enters into a textbox. This part I have working fine, but I also need the dynamically created textboxes to have event handlers of their own, so the user can enter a number…
4
votes
2 answers

When in the page lifecycle we can assign master page?

I know ViewState is available between InitComplete and Preload events in LoadViewSate method. Similarly, I want to know in which page lifecycle event can we assign a master page for a particular page?
Shailesh Jaiswal
  • 3,606
  • 13
  • 73
  • 124