page-lifecycle

What prevents a user from adding controls to an ASP.NET page client side?

This goes back to my other question which I thought was sufficiently answers but upon reflect am not sure that it was (sorry). Backgrounder: I am generating a form dynamically. I am pulling from the database the controls. I must associate each control with a database ID which is not the user's session id. I do this currently by storin...

How to Execute Page_Load() in Page's Base Class?

I have the following PerformanceFactsheet.aspx.cs page class public partial class PerformanceFactsheet : FactsheetBase { protected void Page_Load(object sender, EventArgs e) { // do stuff with the data extracted in FactsheetBase divPerformance.Controls.Add(this.Data); } } where FactsheetBase is defined as ...

What causes markup-controls to be null?

Ok, I have a very strange problem. I have a regular UserControl with some controls in the markup. At Page_Load these controls are still null. And I have tried EnsureChildControls It is laid out like this: Masterpage -> Page -> mycontrol1 -> mycontrol2 -> problemcontrol ProblemControl is where the controls are null. MyControl1 contains...

Dynamically created controls and the ASP.NET page lifecycle

I'm working on an ASP.NET project in which the vast majority of the forms are generated dynamically at run time (form definitions are stored in a DB for customizability). Therefore, I have to dynamically create and add my controls to the Page every time OnLoad fires, regardless of IsPostBack. This has been working just fine and .NET ta...

ASP.NET- forcing child/container events to fire before parent onload?

I'm working on a questionnaire type application in which questions are stored in a database. Therefore, I create my controls dynamically on every Page.OnLoad. This works like a charm and ViewState is persisted between postbacks because I ensure that my dynamic controls always have the same generated Control.ID. In addition to the user ...

Check through Javascript that page is loading something

When the browser is loading something on a page you can see it in the status bar that it says "Waiting for..." or "Transfering..." etc. In firebug you can check in the net tab when something is being loaded and see when it stops. That is what I want. Is there a way for me to trigger an event when that happens ? Or to get the status o...

Dynamically adding controls from an Event after Page_Init

Might seem like a daft title as you shouldn't add dynamic controls after Page_Init if you want to maintain ViewState, but I couldn't think of a better way of explaining the problem. I have a class similar to the following: public class WebCustomForm : WebControl, IScriptControl { internal CustomRender Content { get ...

Event Sequence on ASP.NET page creation

Hello, I'm looking for a good tutorial/article that explains the exact sequence of events that takes place when a page is created. I can never remember the order. I think it's something like the parent controls Init event is called, then the child controls Init event is called, in order of the placement on the page. Also, when the contr...

JSF 2 f:ajax lifecycle problem

The problem is, that if a property is changed during an f:ajax request and a binded panelGroup should be newly created depending on that changed value, the old value is used. This code will explain the problem. Here is the backingbean TestBean: public String getFirst() { return first; } public void setFirst(String firs...

Under ASP.Net MVC v1, is Page_Load called?

Hi, 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 called... Thanks for the reply - to clarify, what I want to do in the Page_Load is the security ...

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 TextBox.Text is part of the viewstate. Now I have found that user supplied values actually aren't ...

Is there an easy way of obtaining the total page response time in ASP.Net?

Hello, commonly on say PHP or other web frameworks getting the total response time is easy, just start the timer at the top of the file and stop it at the end. In ASP.Net there is the whole Page Lifecycle bit though so I'm not sure how to do this. I would like for this response time recording to take place in a master page and the resp...

Building Asp.net Page code behind correctly

Hi everyone, I need some guidelines about building the code behind of my pages correctly. I mean, I'm building in asp.net for a year now, and mostly using the Page_Load event. (and ofcourse "event handling" the events triggered by the user's actions). I know about the page life cycle and the order of events that happens when a page is re...

When to override OnError?

I'm looking into re-working and simplifying our error handling in an application I support. We currently have all of our pages inheriting from a base class we created, which in turn obviously inherits from System.Web.UI.Page. Within this base class, the OnError method is currently being overridden, and in turn calling MyBase.OnError, a...

ASMX equivalent of Page_Init?

I have some code I would like to execute very early in the lifecycle of a call to an ASMX function. For our ASPX pages, this code is in the Page_Init() function on a base class, from which all our ASPX pages inherit. Is there an ASMX equivalent to the ASPX's Page_Init() function? Better yet, is there an ASMX lifecycle diagram like the...

Can I explicitly force asp.NET to re-load the ViewState data of any data-control?

Hi, I have a problem regarding to asp.net lifecylce hierarchy. Basically, I have one user control which has a GridView in it. And this GridView is dynamically generated based on a public property on the control (named Parameter in the simplified code below). Everything is fine when I insert this control in an aspx page, set its Parame...

How do I create a base page event that fires after the derived page's load event?

How do I create a new event in a base page class that fires after all derived pages have fired their load events but before any controls fire their load events. The following code fires the event before the derived page's load event. I want it to fire the event after the derived page's load event but before all control load events: Bas...

There has to be a way to get my data bound at the correct time ...

Say aspx page called theParent has a DataGrid control named theDataGrid and a UserControl named theUserControl , and theUserControl has a button named theUcButton . Yes, I know, very imaginative naming. When theUcButton is clicked , a session variable is changed. This session variable is a select parameter for the datasour...

On postback, how can I check which control cause postback in Page_Init event

On postback, how can I check which control cause postback in Page_Init event. protected void Page_Init(object sender, EventArgs e) { //need to check here which control cause postback? } Thanks ...

jsf - intercept when user departs page

Hi - I have the following 3 simple pages in a JSF app. index.html start.html confirmSuccess.thml start.html is a simple form, with a "GO!" button and a html link back to index.html. When the user clicks GO! it kicks of a transaction in the backing bean. If this fails, I want start.html form redisplayed, but with an error explaining ...